So I made a script that takes player health away and I made a bool value that if it’s on it breaks the loop but it doesn’t break the loop the player still gets health taken away. This is the script:
repeat
wait(0.1)
humanoid:TakeDamage(2)
until player2.PlayerGui.Struggle.Break.Value == true and humanoid.Health <= 2 or script.Parent.Parent.Transformed.Hit.Value == true or humanoid.Parent.Transformed.Value ~= Color3.new(0,0,0) or script.parent.parent.Humanoid.Health <= 0
Is the value of the bool being changed on the client or on the server?
its being changed by a localscript
That’s the problem. If you change the value of the bool on the client, it only changes it for that player. So if you check the value of the bool on the server, it’ll always return true.
1 Like
how can i connect the local script to a server script?
Maybe consider using RemoteEvents. Fire a RemoteEvent from the client to the server when you want to change the value of the bool.
1 Like