✓ Accepted answer
Here I wrote a script for you!
local ammo = script.Parent.Ammo
ammo.Changed:Connect(function()
if ammo.Value <= 0 then
script.Parent.Sound.Disabled = true
end
end)
Now the fun part of reading over the code and seeing what it does!
Line 1 - Referencing the ammo Boolean.
local ammo = script.Parent.Ammo
Line 3 - 7 -- Checking if ammo under number then disabling.
ammo.Changed:Connect(function()
if ammo.Value <= 0 then
script.Parent.Sound.Disabled = true
end
end)
Hope you enjoyed the script!
4 comments
Are there any string, bool or number values in the gun? Also on your script, only the sound will get disabled not the whole script..
Uhm y
Uhmm you need to '.Changed' or 'GetPropertyChangedSignal', else your script only ran once
is that the whole script?