The problem So i have a gun script that adjusts a value called Ammo every time the function ToolActivated() is called the thing is that i want to subtract from that value each time i click not just the first time i clicked. Does anyone here know a way to make it so i can continue subtracting from a intvalue even after i did it once code
01 | local tool = script.Parent |
02 | local mouse = game.Players.LocalPlayer:GetMouse() |
03 | local Ammo = script.Parent.Values.Ammo.Value |
04 | local status = game.StarterPack.DevGun.Values:WaitForChild( "Ammo" ) |
05 | local ShootDelay = script.Parent.Values.ShootDelay.Value |
06 | local debounce = false |
07 |
08 | function ToolActivated() |
09 | if debounce = = false then |
10 | debounce = true |
11 |
12 |
13 | status.Value = Ammo - 1 |
14 |
15 |