|
How would I go about writing a reload sort of script, are there any tutorials on this or could someone explain it to me? I already have a reload animation which is triggered when r is pressed but apart from that I dont know what to do. I need some sort of script which would allow my gun to shoot say 8 times before it has to reload. and then some sort of script which would stop the player from being able to shoot, whilst it reloads. I realize this is all very complex but can anyone help me out?
(comments are locked)
|
|
I don't have any tutorial for you, but you might want to try something like this: C# JavaScript Version: Hope it helps :) Is this java or C# because in java I have the error "expecting semicolon at end"?
Dec 02 '11 at 06:41 PM
Dreave
This is C#, and these functions have to be inside a class to work :)
Dec 02 '11 at 06:45 PM
PaxNemesis
Added the javascript version :)
Dec 02 '11 at 07:05 PM
PaxNemesis
This all works as it should, but is there any way to stop the gun from shooting once the ammo gets to 0?
Dec 02 '11 at 07:25 PM
Dreave
Just remove the Reload call in the Shoot function, then you manually have to reload ^^
Dec 02 '11 at 07:36 PM
PaxNemesis
(comments are locked)
|
