Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why will the thing below not work?

Asked by 3 years ago
Edited 3 years ago
local temp = script.Parent.Value — starts at 0
local heat = game.Workspace.H.Value —- also starts at 0
local cool = game.Workspace.CoolantOn — starts at 0
repeat
wait(1.3)
temp = temp + 5 — adds to the temp
if heat == 1 then — checks if the heat is on
temp = temp + 20 - adds 20 to temp

end
if cool == 1 then — checks if cool is on
temp = temp - 25 — takes away 25 from temp
end
until 1 == 2 — makes a never ending loop (unless math is changed)

If you can solve this, it would be GREATLY appreciated, and yes, those values WERE checked using developer console. They are = to 1. The main point of this code is to change the “temp” Number value, either up or down.

0
I'm a little confused. What should be the starting values of all the variables above and what are you trying to achieve? Nefarioum 162 — 3y
0
All variables start at zero. Except for “temp”, it’s at 350. I want when the value is equal to one, subtract or add that amount. LeoPlaysGames_RBX 26 — 3y
0
That code should work fine then. If cool or heat ever becomes 1 then it will begin to add more to the temp. It will always add 5 every 1 second due to line 6. Nefarioum 162 — 3y
0
Everyone here is denying the fact that the variable itself is converted into a number and not the instance itself. Thus line 6 is like saying "0=0+5" Just remove .Value from the variables and add the .Value where the variables are being used greatneil80 2647 — 3y
0
THANK YOU SO MUCH “greatneil80” YOU ARE A GENIUS!!!! LeoPlaysGames_RBX 26 — 3y

Answer this question