while game.Workspace.CoreOnline == “1” do wait(2) tempVal.Value = if CoolT == 1 then tempVal.Value - 10 end end *error*
You cannot directly use an if statement to check for a condition while declaring a variable or setting a property of something. Instead you could this way to check for a condition:
while game.Workspace.CoreOnline == “1” do wait(2) tempVal.Value -= (CoolT == 1 and 10) or 0 end *error*
So basically this "(CoolT == 1)" returns either true or false and if its true, it proceeds to removing 10 from its value, otherwise, the "or" just tells it to do the other if the one before is not true which in this case would be when "CoolT" does not equal to one.
I hope i helped. Tell me if there's something you dont understand.