The script below has an error saying ("then" expected near "="). If I put a "then" there, it gives me another error saying that the "then" was unexpected. There are no errors regarding the existence of anything in the script, just the error I mentioned.
while true do if Game.Workspace.Increase.Increase.Value = 1 then script.Parent.Value = script.Parent.Value + 1 if Game.Workspace.Decrease.Decrease.Value = 1 then script.Parent.Value = script.Parent.Value + 1 wait(2) script.Parent.Value end
This code should fix your problem. Also please do not start "then" on a new line it made me really confused
while true do if Game.Workspace.Increase.Increase.Value = 1 then script.Parent.Value = script.Parent.Value + 1 if Game.Workspace.Decrease.Decrease.Value == 1 then script.Parent.Value = script.Parent.Value + 1 wait(2) script.Parent.Value end
Hope this helped.
the right script:
while wait(2) do if game.Workspace.Increase.Increase.Value == 1 then script.Parent.Value = script.Parent.Value + 1 end if game.Workspace.Decrease.Decrease.Value == 1 then script.Parent.Value = script.Parent.Value + 1 end end