How to make a Gun in Roblox Studio!

Ойындар

Finally a way to create a gun without having to read every little detail at a time!
Starts from the basics, then adds complexity while being simple to understand.
Reference weapons of what your gun should look like as you are creating:
00:00 How a gun works
www.roblox.com/catalog/730958...
00:48 Basic gun features
www.roblox.com/catalog/731702...
01:21 Sorting your code
www.roblox.com/catalog/732114...
01:46 More gun features
www.roblox.com/catalog/732431...
02:09 Converting your brick to a Model
www.roblox.com/catalog/732453...

Пікірлер: 189

  • @epic4
    @epic42 жыл бұрын

    Just realized: why watch a studio video that shows code when you can just copy the code from the script? So, I'll try to "show" more on how the code works that just telling that the code just does something.

  • @sorawatthapphan8718

    @sorawatthapphan8718

    2 жыл бұрын

    Can you add the ammo in the gun plz??

  • @snoko-YT

    @snoko-YT

    2 жыл бұрын

    that is nice

  • @snoanashi1597

    @snoanashi1597

    Жыл бұрын

    Thank you so much for this tutorial, can't explain how happy I am after managing to make my gun work

  • @ballztojo3824
    @ballztojo38242 жыл бұрын

    wow this is probably the best tutorial I have actually found, nice and customizable

  • @worth1969
    @worth19692 жыл бұрын

    Awesome, what I've been looking for. Fast, simple & easy.

  • @kurfezza7092
    @kurfezza70922 жыл бұрын

    my man really created an entire gun kit within 2 minutes of the video keep up the great tutorials

  • @chocotsukii3174
    @chocotsukii31742 жыл бұрын

    This is really useful! Thank you :D

  • @dr.samtyy4731
    @dr.samtyy47312 жыл бұрын

    I'm trying to learn fast and that helping me a lot, i didn't used the RayCast part, instead i used Touched function, but that helped me a lot, it's my first time doing a gun!

  • @questionableperson8293
    @questionableperson82932 жыл бұрын

    this is very useful and informative

  • @hennynovita6490
    @hennynovita64902 жыл бұрын

    i was litterally searching how to make a part fires to the top then lands to the target part forever. because of this, i can finally create boulder throw

  • @user-wf3mp1xl8t
    @user-wf3mp1xl8t2 жыл бұрын

    This is so cool!

  • @N1lloq
    @N1lloq Жыл бұрын

    This is awesome!

  • @drakosor677
    @drakosor6772 жыл бұрын

    Woah, nice one Epic

  • @agarlordpro
    @agarlordpro2 жыл бұрын

    Thank you SO much

  • @kishi3003
    @kishi30032 жыл бұрын

    THANK YOU VERY MUCH!!!

  • @bird6754
    @bird67542 жыл бұрын

    thats pretty cool

  • @NeooRoblox
    @NeooRoblox2 жыл бұрын

    The Video: 2 mins Me: *Takes a whole day to learn everything*

  • @templink2153
    @templink21532 жыл бұрын

    This is a nice Chanel u get my sub

  • @epic4

    @epic4

    2 жыл бұрын

    thank you

  • @lossycompressed
    @lossycompressed Жыл бұрын

    thank you so much, i reverse engineered the bullet visuals to make a grenade launcher lol

  • @SkyStriker1243
    @SkyStriker1243 Жыл бұрын

    I mainly came here for the part on bullet tracers. Half of the time the tracer didn't show up.

  • @iceking_7892
    @iceking_78922 жыл бұрын

    Hey how do you add a crosshair and make shoulder camera and zoom to the gun a video on that please

  • @SpazzoFTB
    @SpazzoFTB2 жыл бұрын

    How would I go about making a crosshair for the gun instead of the normal mouse, and mind doing a tutorial so we can learn how to limit the ammo and make it so they need 'magazine' (Tool of that specified gun ammo in their inventory) to reload and then remove the 'magazine' tool from their inventory?

  • @temp1769

    @temp1769

    Жыл бұрын

    gui

  • @mysticaltree273
    @mysticaltree2732 жыл бұрын

    hey uh i saw you in a match in noobs vs zombies, i was the one who said "wait, you look familar" "Like i've seen you in a video before"

  • @Azurey903
    @Azurey9032 жыл бұрын

    Thank you! I needed this for my remake of Call of Mini™ Zombies!

  • @kishi3003
    @kishi30032 жыл бұрын

    Hey i have a question, How do i add a ammo thing on this? can you make a tutorial with that?

  • @john681B
    @john681B2 жыл бұрын

    BRUUUUH INSTANT SUB BRO

  • @reku6330
    @reku63303 ай бұрын

    Do you know how to convert the round per minute to seconds?

  • @martinaussie1496
    @martinaussie14962 жыл бұрын

    am going to say the g word giga gargantuar

  • @martinaussie1496

    @martinaussie1496

    2 жыл бұрын

    WHO LIKED THIS COMMENT 15 SECS AGO

  • @zj2654
    @zj2654 Жыл бұрын

    can i just take the code or something and put it in another model?

  • @acrazycookiebr
    @acrazycookiebr2 жыл бұрын

    Could you make a reload system?? I Think a gun with infinite bullets would be an bad idea if you wanted to create an actual game

  • @oxogaming7273
    @oxogaming72732 жыл бұрын

    Where to put bullet part??? I keep getting error and the bullet did not even came out for me :(

  • @16.phanvinhhoang68
    @16.phanvinhhoang682 жыл бұрын

    Hello! I had a quick question. I add a few changes to the script to make it cooldown. How can I make it so, if the bullets hit a player, the cooldown increase to 10 seconds, if it doesn't hit anyone, you just need to wait 1 second to fire again. Pls help!

  • @epic4

    @epic4

    2 жыл бұрын

    You can make a timing system that prevents further firing the gun when shot before the fire function, then the timer activates based on the outcome when the function returns something (add variable name to task spawn) Make sure the velocity relative to range isn't too small or the player is going to have to wait more than 10 seconds

  • @nexo8679
    @nexo86792 жыл бұрын

    it took me so long to make a gun

  • @YeetoTheYeetafic
    @YeetoTheYeetafic Жыл бұрын

    when he auto-fired the gun I actually started acting like I was getting shot, but I wasn't acting it just happened...

  • @_reddit-time_
    @_reddit-time_2 жыл бұрын

    The tutorial is great and all but some parts are confusing like you show one part of the script them another one without showing what's before so idk when to put this line of code example at 0:26 idk if I have to delete a line or just add cause the lines have changed

  • @kkensantana

    @kkensantana

    Жыл бұрын

    Look at the line numbers and you’ll see

  • @bluelightning3948

    @bluelightning3948

    Жыл бұрын

    Im struggling with that too idk why but its not working properly

  • @bluelightning3948

    @bluelightning3948

    Жыл бұрын

    I found the problem the new code must be put inside the while loop and make sure to delete 'lastPos - bullet.Position'

  • @epic4
    @epic42 жыл бұрын

    Do you guys think coding tutorials lack a bit of "energy"? update: there is currently a better video that I made go here: kzread.info/dash/bejne/mqCTlbCSaaXHe6Q.html

  • @goose13378

    @goose13378

    2 жыл бұрын

    idk, but how are you still motivated? u barley get any subs

  • @epic4

    @epic4

    2 жыл бұрын

    I learned a lot and my motivation came from doing something not just school/college

  • @goose13378

    @goose13378

    2 жыл бұрын

    @@epic4 oh okay!

  • @goose13378

    @goose13378

    2 жыл бұрын

    @@epic4 btw i have a question, how do i make the gun semi-auto?

  • @epic4

    @epic4

    2 жыл бұрын

    @@goose13378 remove the while loop in the local script that is supposed to keep firing as long as you hold the mouse down

  • @Cosharkvr
    @Cosharkvr Жыл бұрын

    on giving the gun a range limit it will not work only the other things will

  • @Xyearo
    @Xyearo Жыл бұрын

    how do you add idle and firing animations to it?

  • @meo-toph6002
    @meo-toph60022 жыл бұрын

    yeah umm, about that, i tried but my gun won't shoot out bullets why's that?

  • @space_flight_simulator_2
    @space_flight_simulator_2Ай бұрын

    Are we able to get this model?

  • @27Chad
    @27Chad2 жыл бұрын

    Can you add like a gui that shows how much ammo you have?

  • @mylockredowait3897
    @mylockredowait38972 жыл бұрын

    In the script it says that bullet is not found yet all the other lines does not have blue line under it when I typed in bullet please help.

  • @arjunthemadlad
    @arjunthemadlad2 жыл бұрын

    That looks like the realish AA-12

  • @joeyboyok40K
    @joeyboyok40K8 ай бұрын

    I can't follow you. From the 44th second my system couldn't fire. And there is no damage. I don't understand. I want to follow along and understand. without loading your sample But I ended up stuck at 44th second for 2 hours.

  • @calesito3346
    @calesito33462 жыл бұрын

    idk if i did something, but its only playing the click sound when im trying to fire. sorry im very dumb when it comes to scripting

  • @agoshdarnlad
    @agoshdarnlad2 жыл бұрын

    Aw hell yeah

  • @mynamesmatthew1551
    @mynamesmatthew1551 Жыл бұрын

    Can you make any gun model and group that and use that in the same way you showed

  • @TheAmazingAutisticWarrior
    @TheAmazingAutisticWarrior Жыл бұрын

    how do you make aim down sights

  • @noobzikcool2720
    @noobzikcool27202 жыл бұрын

    I'm have bad internet and gun lags when im shoot. How to fix lags?

  • @HelloImStraight
    @HelloImStraight9 ай бұрын

    do i copy print scrip?

  • @crackedtadacktle1003
    @crackedtadacktle10032 жыл бұрын

    Wow

  • @america9332
    @america93322 жыл бұрын

    MAKE MORE NVZT2 SHORTS OR GAMEPLAY BECAUSE I SAW U IN MY GAME MY NAME WAS KAI

  • @Skillfoolgamer
    @Skillfoolgamer2 жыл бұрын

    How would I make it only shoot the middle of the screen pls help

  • @wotah2170
    @wotah21702 жыл бұрын

    how do I add the sounds tho

  • @gachaluke4658
    @gachaluke4658 Жыл бұрын

    You know what your going to fast I think I will go find code on the dev forum

  • @James-zd1iu
    @James-zd1iu2 жыл бұрын

    How you make animate your gun tool?

  • @kayemm0975
    @kayemm0975 Жыл бұрын

    0:57 -saving time

  • @OnlyJay_WasHere
    @OnlyJay_WasHere2 жыл бұрын

    Cool tutorial! My only problem is that the bullets won't spread out when I make a shotgun. Can you help me with that?

  • @scarcehdx1746

    @scarcehdx1746

    Жыл бұрын

    add spread to the spread factor

  • @gnomer_gnomer7074
    @gnomer_gnomer70742 жыл бұрын

    0:24 ignore this just marking it for later

  • @nightmare-jp1be
    @nightmare-jp1be2 жыл бұрын

    how can i add animations to the gun????

  • @minhafamilia8864
    @minhafamilia88642 жыл бұрын

    Don't forget to put animations In the guns lol

  • @djkustomsrplays7300
    @djkustomsrplays73002 жыл бұрын

    Can you do the Safety mode like Hold your gun down or gun down

  • @ZagoraZz

    @ZagoraZz

    Жыл бұрын

    try "unequipping" the weapon

  • @orangenetic
    @orangenetic2 жыл бұрын

    Nice tutorial. - DangerRangerJJD

  • @epic4

    @epic4

    2 жыл бұрын

    thanks

  • @scarcehdx1746
    @scarcehdx1746 Жыл бұрын

    how to i disable full auto?

  • @heetman5925
    @heetman59252 жыл бұрын

    ammo system?

  • @kizaruadmiral3794
    @kizaruadmiral37942 жыл бұрын

    what are those between direction, mass and muzzleVelocity?

  • @epic4

    @epic4

    2 жыл бұрын

    Multiply symbol so the physics based bullet can be pushed at the right velocity and direction

  • @Blue_Eureka
    @Blue_Eureka2 жыл бұрын

    It's stuck clicking, I can't shoot, only make a clicking sound.

  • @dababyplatinum9819
    @dababyplatinum98192 жыл бұрын

    yo i miss ur base raider vid

  • @stealth_chan
    @stealth_chan7 ай бұрын

    doesnt work :( it teleports me somewhere and only makes sound :(

  • @sKn2590
    @sKn2590 Жыл бұрын

    idk why but the bullets are invisible someone help, for some reason

  • @ryanhe7823
    @ryanhe78232 жыл бұрын

    Can you help when I use the guns the bullets appear in the sky and don’t shoot where my mouse is

  • @ryanhe7823

    @ryanhe7823

    2 жыл бұрын

    nvm it works now

  • @Trxps
    @Trxps2 жыл бұрын

    i'm so confused as to what ur doing to the code the line numbers keep changing, why u deleting parts of the script, would be easier just to show the whole thing man

  • @epic4

    @epic4

    2 жыл бұрын

    Yeah I'm planning a third remake video on the gun where I predict it would be much easier to understand than the current first or second video I made The second video is slightly easier to understand and also has a much less laggy gun

  • @konsh0rts
    @konsh0rts2 жыл бұрын

    I getting problem at 0:26 Please help

  • @martinaussie1496
    @martinaussie14962 жыл бұрын

    funni aa-12 from realish

  • @sirheinrich8882
    @sirheinrich88822 жыл бұрын

    I dont understand at 0:14, which script im gonna write in

  • @epic4

    @epic4

    2 жыл бұрын

    its just called "script" aka the script object in tool not localscript

  • @cryptid9361
    @cryptid93612 жыл бұрын

    everything was good until i added the ray filted it doesnt hurt other players unless the gun itself is touching them and doesnt shoort bullets, any idea how to fix this?

  • @epic4

    @epic4

    2 жыл бұрын

    make sure there is a bullet filter so the bullet doesnt "hit" the gun or your character

  • @cryptid9361

    @cryptid9361

    2 жыл бұрын

    @@epic4 Thank you

  • @zarsty3648
    @zarsty36482 жыл бұрын

    at 1:04 the script is kinda off camera so I don't know where to start

  • @zarsty3648

    @zarsty3648

    2 жыл бұрын

    so what line is this and which script

  • @ServerServer-vb4oj

    @ServerServer-vb4oj

    Жыл бұрын

    @@zarsty3648 same

  • @user-yi2tb5un5x
    @user-yi2tb5un5x2 жыл бұрын

    Can i get the model for your flat gun, But make it box please thanks.

  • @user-yi2tb5un5x

    @user-yi2tb5un5x

    2 жыл бұрын

    Oh wait you already put at the Description sorry.

  • @user-yi2tb5un5x

    @user-yi2tb5un5x

    2 жыл бұрын

    But how to make it to a block

  • @scrude657
    @scrude6572 жыл бұрын

    my brain

  • @unexpectedme9992
    @unexpectedme99922 жыл бұрын

    Is fastcast a great choice too?

  • @epic4

    @epic4

    2 жыл бұрын

    I would say fastcast might perform as well as my gun problem is fastcast seems really unorganized and difficult to setup

  • @unexpectedme9992

    @unexpectedme9992

    2 жыл бұрын

    @@epic4 Hey..uh if i like you know copyed your script wouldn't be that stealing and a reason to roblox removing my game?

  • @unexpectedme9992

    @unexpectedme9992

    2 жыл бұрын

    @@epic4 also can hackers copy this?

  • @epic4

    @epic4

    2 жыл бұрын

    I made my code public so you can just copy it Hackers if playing on your game cannot copy the server script but can copy the local script although it would take time to decode it

  • @unexpectedme9992

    @unexpectedme9992

    2 жыл бұрын

    @@epic4 THANKS

  • @shmitler8473
    @shmitler84732 жыл бұрын

    My item is hold opposite way how to fix ?

  • @epic4

    @epic4

    2 жыл бұрын

    Rotate the handle part around

  • @malix300
    @malix3002 жыл бұрын

    How do i make the character hold the gun properly?

  • @Cosharkvr

    @Cosharkvr

    Жыл бұрын

    get a tool grip editor

  • @ysmr.s
    @ysmr.s2 жыл бұрын

    Can U Make Reload And Reload Animation?

  • @epic4

    @epic4

    2 жыл бұрын

    Reload and ammo would be part of a part 2 after I remake my vid

  • @ysmr.s

    @ysmr.s

    2 жыл бұрын

    @@epic4 ok, thanks for replying my comment

  • @yiff
    @yiff2 жыл бұрын

    I like the idea of this video, but it gets extremely confusing extremely quickly having to rewrite code over and over. Wouldn't it be better to just organise the code from the start? (Most notably writing code only to have to chop it all up into seperate functions later) Edit: And as of 1:28 you've completely lost me. What code do I put where? Why are the updateTracer and hitDetection functions empty? What does the getTracer function do?

  • @epic4

    @epic4

    2 жыл бұрын

    True it would be better if I showed where the new code goes by highlighting them with comparison to before then show what the highlighted functions and code do I'm currently making the new tutorial similar to what you said in hopes people both understand and stay not bored

  • @seg0o
    @seg0o2 жыл бұрын

    Speedrun tutorial

  • @romancho1865
    @romancho18652 жыл бұрын

    i dont understand a thing at 0:15

  • @caodannguyen8949
    @caodannguyen89492 жыл бұрын

    so uh how to make the gun ammo?

  • @epic4

    @epic4

    2 жыл бұрын

    i havent done that yet but i would show in a part 2 after i remake my vid

  • @Depressed_Rose.
    @Depressed_Rose.2 жыл бұрын

    who is teached u?

  • @epic4

    @epic4

    2 жыл бұрын

    I learned it myself and from the other vids I watched although most of the vids were both boring, slow and confusing

  • @Marioman73
    @Marioman732 жыл бұрын

    Did you actually make the bullets server-sided? Such a horrible mistake.

  • @epic4

    @epic4

    2 жыл бұрын

    yeah i did it like that cause i dont know how to make guns that do no lag but are accurate

  • @Marioman73

    @Marioman73

    2 жыл бұрын

    @@epic4 What do you mean by accurate?

  • @Marioman73

    @Marioman73

    2 жыл бұрын

    Because bullet visuals will be VERY inconsistent when you have an actual game going

  • @epic4

    @epic4

    2 жыл бұрын

    i mean accurate by how i see the bullet reach the person not the delay of the bullet appearing You can tell me how I should do the visuals then

  • @Marioman73

    @Marioman73

    2 жыл бұрын

    @@epic4 Step 1. Gun is shot, fires event to all clients (along with bullet info such as where its going, its color, where it started ,etc) Step 2. Client receives event on a script (NOT PART OF THE GUN) Step 3. Client creates and sets up a part that would be the bullet visual with the information received Step 4. Client basically does all the bullet stuff with said bullet, but only visuals (so it won't actually deal damage or anything - You can make the bullet smooth via tweening it, and since the tween is client-sided its not gonna be choppy at all There should be *no* parts on the server, the bullet should purely be simulated via raycasting.

  • @alphapham2060
    @alphapham20602 жыл бұрын

    Can you make a longer video showing where scripts should be inserted?

  • @epic4

    @epic4

    2 жыл бұрын

    i thought i said all the scripts i talked about were in tool at the first seconds of the vid

  • @cheems6085

    @cheems6085

    2 жыл бұрын

    @@epic4 I think he meant where the fragments of the script displayed in the video should be in

  • @novaesc844
    @novaesc844 Жыл бұрын

    jesus

  • @edgardogarmendiabri7531
    @edgardogarmendiabri75312 жыл бұрын

    hi, could you help me create some weapons?

  • @edgardogarmendiabri7531

    @edgardogarmendiabri7531

    2 жыл бұрын

    I pay you 200 robux

  • @RBT12-rc6lj
    @RBT12-rc6lj Жыл бұрын

    Why my script is not working : script.Parent.RemoteEvent.OnServerEvent:Connect(function(player,mousePos) local bullet = Instance.new("Part") bullet.Position = script.Parent.Handle.Position bullet.CanCollide = false bullet.Size = Vector3.new(1,1,1) bullet.Name = "bullet" bullet.Parent = workspace local muzzleVelocity = 300 local direction = CFrame.new(bulllet.Position,mousePos).LookVector local mass = bullet:GetMass() bullet:ApplyImpulse(direction • mass • muzzleVelocity) end)

  • @ItPindit

    @ItPindit

    Жыл бұрын

    in between "direction" "mass" and "muzzleVelocity" you are using the wrong symbol. Correct simble is the asterisk. Hold shift and press 8 on your keyboard, or copy this --> *

  • @Flopper414
    @Flopper414 Жыл бұрын

    i don't understand they all are confusing

  • @II-oh8eq
    @II-oh8eq2 жыл бұрын

    somebody paste in "script" bc hes deleting stuff and adding stuff, its not making sense.

  • @epic4

    @epic4

    2 жыл бұрын

    I have the model that has the final script just check the last link in description

  • @gamerfuture456
    @gamerfuture4562 жыл бұрын

    how to animate the guns????

  • @epic4

    @epic4

    2 жыл бұрын

    I create a new animation within tool then I load and play it in the local script when something happens like I equip tool

  • @gamerfuture456

    @gamerfuture456

    2 жыл бұрын

    @@epic4 thank you

  • @codenil6745
    @codenil6745 Жыл бұрын

    Hello There, so i made a gun from the tutorial, but the barrel position doesn't work somehow... Is it possible if you can explain?.. Thanks.

  • @epic4

    @epic4

    Жыл бұрын

    If you are talking about having the gun shoot from the barrel don't forget to change the start position to the barrel position

  • @codenil6745

    @codenil6745

    Жыл бұрын

    @@epic4 Yes, i did change the the position to the barrel, but the bullets became invisible and i could only hear the sound effects

  • @tengkuadam2891
    @tengkuadam28912 жыл бұрын

    Gaming

  • @saltyboi2435
    @saltyboi24352 жыл бұрын

    0:41

  • @mishyak.unused
    @mishyak.unused Жыл бұрын

    Is there a how to make a reloading for a gun guide?

  • @Abd-fe1wn
    @Abd-fe1wn2 жыл бұрын

    Bruh just make this a model this takes 5 hours to make

  • @axjosjdsoids356
    @axjosjdsoids3562 жыл бұрын

    it would be cool if u give the script

  • @epic4

    @epic4

    2 жыл бұрын

    If you check description the model has the finished script

  • @antekpl.8205

    @antekpl.8205

    2 жыл бұрын

    also point of video is to make you understand how to do it. i mean you need to learn it not to get finished script already beacuse you are not learning this way.

Келесі