I already have the gun ready, it's just that I have two issues. Problem number one is not being able to pull the gun out without it exploding. Second deal is I have no clue how to make animations for it. Thanks, I appreciate the help.
Also could you guys give me a quick tutorial about "local"?
I'm sorry I can't help with the gun but a tutorial about local. Instead of calling a variable in a chunk of code (function,loops,if statements, basically anything that needs an end)
function Hi() Var=5 print (Var) end
You could do this.
function Hi() local Var=5 print (Var) end
This basically deletes the Variable once the function has been complete but when fired again the variable will re appear and so on.
Ah, so many questions in one!
"Being able to pull the gun out without it exploding"
You'll need to become familiar with the Weld
Object, this is used to sustain parts relative to other parts (Weld them together)
http://wiki.roblox.com/index.php?title=Weld
There is a tutorial on using them here:
http://wiki.roblox.com/index.php?title=Welds
You can also find some ready-to-go "Autoweld" scripts in Free Models that do this sort of thing.
"I have no clue how to make animations for it"
Do you mean animating the gun itself, or the limbs of the Player who is using it?
If you mean the gun itself, you can animate it by adjusting the C0
and C1
(these are CFrame
s) properties of the Welds for each part that you want to animate.
If you mean the Player's limbs: You can find the Weld
s (They are actually Motor6D
s, but they behave the same when it comes to animating) holding the Player's arms and legs and head in the Torso
, they are called Right Shoulder
, Left Shoulder
, Right Hip
, Left Hip
, and Neck
. You can animate these by changing the C0
and C1
properties as well.
I hope that that's enough to get you started!
Edit: It's probably best to ask about "local" in a separate thread, also you haven't specified what you mean very well. You might be interested in LocalScript
s:
http://wiki.roblox.com/index.php?title=Local_script
...or local variables, there is an article on those here (at the bottom):