i need the script for reloading? if the script could be something like when the ammo count reaches 0, after 5 seconds in will reset to its original count.
Hi here is a very simple script
var ammoinclip:int = 0;
var ammoperclip:int = 15;
var ReloadAnim:AnimationClip;
var Weapon:Transform;
function Start(){
ammoinclip = ammoperclip;
}
function Update(){
if(ammoinclip <=0){
Reload();
}
}
function Reload(){
Weapon.animation.Play(ReloadAnim.name);
yield WaitForSeconds(Weapon.animation[ReloadAnim.name].length);///Thanks to fatfase i now know a new way to waitforseconds instead of using if(!Weapon.animation.IsPlaying(ReloadAnim.name))
ammoinclip = ammoperclip;
}