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

Can anybody help me with another thing about my reactor core meltdown?

Asked by 5 years ago

Roblox is not giving me any errors but this script that I made called "GateStart" will not start "Gate". This is my script:

if game.Workspace.Temp.Value == 1750 then

    game.Workspace.Gate.Disabled = false

end

Like I said, Roblox is giving no errors for this code. Can anybody help?

0
well according to what u wrote ur trying to tell the script to disable the gate once the temp reaches the value of1750 instead of starting the gate Gameplayer365247v2 1055 — 5y
0
I put disabled = false Not_TheOnlyTree 11 — 5y
0
so the script is called Gate and is a child of workspace Gameplayer365247v2 1055 — 5y
0
yes. Not_TheOnlyTree 11 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

try putting it in a while loop. by putting it in a while loop, it will constantly check to see if the given statement is true, otherwise it will only check once when the script first runs.

while wait() do

if workspace.Temp.Value == 1750 then

workspace.Gate.Disabled = false

end

end
0
I got no error but "Gate" won't execute. Not_TheOnlyTree 11 — 5y
0
Gate says this: Not_TheOnlyTree 11 — 5y
0
script.Parent.alarm:Play() local g = Instance.new("Hint",Workspace) g.Text = "Self Destruct Seqence Activated!" wait(15) g:Destroy() script.Parent.alarm:Stop() script.Countdown.Disabled = false Not_TheOnlyTree 11 — 5y
Ad
Log in to vote
1
Answered by 5 years ago

Okay, what I noticed is that your code only works if the value is at 1750. If you want the code to work above or below that value, do this

if game.Workspace.Temp.Value => 1750 then
game.Workspace.Gate.Disabled = false --You can change this
else
if game.Workspace.Temp.Value <= 1750 then
        game.Workspace.Gate.Disabled = true --You can change this
end
0
That's stupid. One sign should not have an equal sign. DeceptiveCaster 3761 — 5y
0
Well, it works, buddy LordTechet 53 — 5y
0
it's <, > , = , == and >=. Not_TheOnlyTree 11 — 5y

Answer this question