I made a script where as long as it's activated, a loop runs to increase IntValueA by IntValueB.
For Example: IntValueA = 0 IntValueB = 10
The first loop runs, and IntValueA is now 10, it runs again and it becomes 20. Normal and works perfect. If I change IntValueB however, it still increases by 10 instead of whatever I set it to. Why?? Also, Damage is IntValueB, Charge is IntValueA.
local debounce = false local damage = script.Parent.Damage script.Parent.Activated:Connect(function() if debounce==false then debounce = true script.Parent.Charging.Value = true while script.Parent.Charging.Value==true do print(damage.Value) script.Parent.Charge.Value = script.Parent.Charge.Value +(damage.Value) print ("obama") if script.Parent.Charging.Value==false then break end wait(1) end end end) script.Parent.Deactivated:Connect(function() print ("Nobama") script.Parent.Charging.Value = false wait(0.5) script.Parent.Charge.Value = 0 wait(1.5) debounce = false end)
How did you change the value of intValueB?
Make sure you didnt change the one insideStarterPack
but instead the one inside the player's Backpack
or the player's character if equipped
Edit :
Did you change the value using a localscript?
It will only change the value locally and wont be replicated to the server and other players
so try doing it via a server script or use remote event