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
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
2 жыл бұрын
Can you add the ammo in the gun plz??
@snoko-YT
2 жыл бұрын
that is nice
@snoanashi1597
Жыл бұрын
Thank you so much for this tutorial, can't explain how happy I am after managing to make my gun work
wow this is probably the best tutorial I have actually found, nice and customizable
Awesome, what I've been looking for. Fast, simple & easy.
my man really created an entire gun kit within 2 minutes of the video keep up the great tutorials
This is really useful! Thank you :D
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!
this is very useful and informative
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
This is so cool!
This is awesome!
Woah, nice one Epic
Thank you SO much
THANK YOU VERY MUCH!!!
thats pretty cool
The Video: 2 mins Me: *Takes a whole day to learn everything*
This is a nice Chanel u get my sub
@epic4
2 жыл бұрын
thank you
thank you so much, i reverse engineered the bullet visuals to make a grenade launcher lol
I mainly came here for the part on bullet tracers. Half of the time the tracer didn't show up.
Hey how do you add a crosshair and make shoulder camera and zoom to the gun a video on that please
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
Жыл бұрын
gui
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"
Thank you! I needed this for my remake of Call of Mini™ Zombies!
Hey i have a question, How do i add a ammo thing on this? can you make a tutorial with that?
BRUUUUH INSTANT SUB BRO
Do you know how to convert the round per minute to seconds?
am going to say the g word giga gargantuar
@martinaussie1496
2 жыл бұрын
WHO LIKED THIS COMMENT 15 SECS AGO
can i just take the code or something and put it in another model?
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
Where to put bullet part??? I keep getting error and the bullet did not even came out for me :(
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
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
it took me so long to make a gun
when he auto-fired the gun I actually started acting like I was getting shot, but I wasn't acting it just happened...
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
Жыл бұрын
Look at the line numbers and you’ll see
@bluelightning3948
Жыл бұрын
Im struggling with that too idk why but its not working properly
@bluelightning3948
Жыл бұрын
I found the problem the new code must be put inside the while loop and make sure to delete 'lastPos - bullet.Position'
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
2 жыл бұрын
idk, but how are you still motivated? u barley get any subs
@epic4
2 жыл бұрын
I learned a lot and my motivation came from doing something not just school/college
@goose13378
2 жыл бұрын
@@epic4 oh okay!
@goose13378
2 жыл бұрын
@@epic4 btw i have a question, how do i make the gun semi-auto?
@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
on giving the gun a range limit it will not work only the other things will
how do you add idle and firing animations to it?
yeah umm, about that, i tried but my gun won't shoot out bullets why's that?
Are we able to get this model?
Can you add like a gui that shows how much ammo you have?
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.
That looks like the realish AA-12
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.
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
Aw hell yeah
Can you make any gun model and group that and use that in the same way you showed
how do you make aim down sights
I'm have bad internet and gun lags when im shoot. How to fix lags?
do i copy print scrip?
Wow
MAKE MORE NVZT2 SHORTS OR GAMEPLAY BECAUSE I SAW U IN MY GAME MY NAME WAS KAI
How would I make it only shoot the middle of the screen pls help
how do I add the sounds tho
You know what your going to fast I think I will go find code on the dev forum
How you make animate your gun tool?
0:57 -saving time
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
Жыл бұрын
add spread to the spread factor
0:24 ignore this just marking it for later
how can i add animations to the gun????
Don't forget to put animations In the guns lol
Can you do the Safety mode like Hold your gun down or gun down
@ZagoraZz
Жыл бұрын
try "unequipping" the weapon
Nice tutorial. - DangerRangerJJD
@epic4
2 жыл бұрын
thanks
how to i disable full auto?
ammo system?
what are those between direction, mass and muzzleVelocity?
@epic4
2 жыл бұрын
Multiply symbol so the physics based bullet can be pushed at the right velocity and direction
It's stuck clicking, I can't shoot, only make a clicking sound.
yo i miss ur base raider vid
doesnt work :( it teleports me somewhere and only makes sound :(
idk why but the bullets are invisible someone help, for some reason
Can you help when I use the guns the bullets appear in the sky and don’t shoot where my mouse is
@ryanhe7823
2 жыл бұрын
nvm it works now
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
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
I getting problem at 0:26 Please help
funni aa-12 from realish
I dont understand at 0:14, which script im gonna write in
@epic4
2 жыл бұрын
its just called "script" aka the script object in tool not localscript
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
2 жыл бұрын
make sure there is a bullet filter so the bullet doesnt "hit" the gun or your character
@cryptid9361
2 жыл бұрын
@@epic4 Thank you
at 1:04 the script is kinda off camera so I don't know where to start
@zarsty3648
2 жыл бұрын
so what line is this and which script
@ServerServer-vb4oj
Жыл бұрын
@@zarsty3648 same
Can i get the model for your flat gun, But make it box please thanks.
@user-yi2tb5un5x
2 жыл бұрын
Oh wait you already put at the Description sorry.
@user-yi2tb5un5x
2 жыл бұрын
But how to make it to a block
my brain
Is fastcast a great choice too?
@epic4
2 жыл бұрын
I would say fastcast might perform as well as my gun problem is fastcast seems really unorganized and difficult to setup
@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
2 жыл бұрын
@@epic4 also can hackers copy this?
@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
2 жыл бұрын
@@epic4 THANKS
My item is hold opposite way how to fix ?
@epic4
2 жыл бұрын
Rotate the handle part around
How do i make the character hold the gun properly?
@Cosharkvr
Жыл бұрын
get a tool grip editor
Can U Make Reload And Reload Animation?
@epic4
2 жыл бұрын
Reload and ammo would be part of a part 2 after I remake my vid
@ysmr.s
2 жыл бұрын
@@epic4 ok, thanks for replying my comment
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
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
Speedrun tutorial
i dont understand a thing at 0:15
so uh how to make the gun ammo?
@epic4
2 жыл бұрын
i havent done that yet but i would show in a part 2 after i remake my vid
who is teached u?
@epic4
2 жыл бұрын
I learned it myself and from the other vids I watched although most of the vids were both boring, slow and confusing
Did you actually make the bullets server-sided? Such a horrible mistake.
@epic4
2 жыл бұрын
yeah i did it like that cause i dont know how to make guns that do no lag but are accurate
@Marioman73
2 жыл бұрын
@@epic4 What do you mean by accurate?
@Marioman73
2 жыл бұрын
Because bullet visuals will be VERY inconsistent when you have an actual game going
@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
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.
Can you make a longer video showing where scripts should be inserted?
@epic4
2 жыл бұрын
i thought i said all the scripts i talked about were in tool at the first seconds of the vid
@cheems6085
2 жыл бұрын
@@epic4 I think he meant where the fragments of the script displayed in the video should be in
jesus
hi, could you help me create some weapons?
@edgardogarmendiabri7531
2 жыл бұрын
I pay you 200 robux
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
Жыл бұрын
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 --> *
i don't understand they all are confusing
somebody paste in "script" bc hes deleting stuff and adding stuff, its not making sense.
@epic4
2 жыл бұрын
I have the model that has the final script just check the last link in description
how to animate the guns????
@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
2 жыл бұрын
@@epic4 thank you
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
Жыл бұрын
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
Жыл бұрын
@@epic4 Yes, i did change the the position to the barrel, but the bullets became invisible and i could only hear the sound effects
Gaming
0:41
Is there a how to make a reloading for a gun guide?
Bruh just make this a model this takes 5 hours to make
it would be cool if u give the script
@epic4
2 жыл бұрын
If you check description the model has the finished script
@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.