Greetings, it depends on how you have your scripts set up and how you have the ammo set-up.
One way for example is to have a number value set in global properties (for a player). In your shooting script, have it check if the number value is above zero, and if so, to fire a shot and subtract ammo from the number value.
EX (you will have to adjust to fit your specific script)
if global.property["ammoinmagazine"] > 0 then //checks if there is ammo in the magazine
//insert whatever stuff happens when you fire the weapon here
global.property["ammoinmagazine"] -= 1; //subtracts one bullet from the magazine
end;
Building from that:
if global.property["ammoinmagazine"] > 0 then //checks if there is ammo in the magazine
//insert whatever stuff happens when you fire the weapon here
global.property["ammoinmagazine"] -= 1; //subtracts one bullet from the magazine
elseif global.property["ammoinmagazine"] == 0 then //only applies if you are out of ammo
print("out of ammo!");
//you can also add more code to say, display a message that you are out of ammo
end;
Further building from that:
if global.property["ammoinmagazine"] > 0 then //checks if there is ammo in the magazine
//insert whatever stuff happens when you fire the weapon here
global.property["ammoinmagazine"] -= 1; //subtracts one bullet from the magazine
elseif global.property["ammoinmagazine"] == 0 then //only applies if you are out of ammo
print("got to reload!");
wait(3); //waits 3 seconds to simulate reload time
global.property["ammoinmagazine"] = 30; //puts 30 bullets in the magazine
end;
You can further expand the code to meet your needs, but I hope this gives a good starting point.