it wont recolor the CompLights after the value became true (that happend with another script and I tested it, that worked perfect) can someone help me?
System = game.Workspace.System AlertV = System.AlertV if AlertV.Value == true then for i, v in pairs(game.Workspace:GetChildren()) do if v.Name == 'CompLight' then v.BrickColor = BrickColor.new('Really red') end end
while true do Current = game.Workspace.System.Temperature CurrentV = game.Workspace.System.Temperature.Value SysON = game.Workspace.System.SysON function NewText() game.Workspace.MasterScreen.MasterScreen.Gui.Frame.Temp.Text = ""..CurrentV.." C" end NewText() if SysON.Value == true then wait(5) Current.Value = Current.Value + 2 end NewText() if Current.Value == 1200 then game.Workspace.System.AlertV.Value = true end end
Is this the whole script? The script doesn't loop or contain a function or anything, so when it is inserted into the Workspace (or wherever it's supposed to go to) it will only run once. To fix this, you can try creating a loop that checks whether or not AlertV.Value == true
. Also, it appears you're missing an end in the script.
System = game.Workspace.System AlertV = System.AlertV while wait() do if AlertV.Value == true then for i, v in pairs(game.Workspace:GetChildren()) do if v.Name == 'CompLight' then v.BrickColor = BrickColor.new('Really red') end end end end
Note that this script will constantly run and recolor CompLight. If this is a problem, you can try breaking the loop. I hope this helped!