local Window = script.Parent.Window local Doorhole = script.Parent.Doorhole function Lightsoff() Window.BrickColor = BrickColor.new("Really black") Doorhole.BrickColor = BrickColor.new("Really black") end function Lightson() Window.BrickColor = BrickColor.new("CGA brown") Doorhole.BrickColor = BrickColor.new("CGA brown") end while true do wait(.1) if game.Workspace.TimeInMinutes.Value == 1140 then Lightson() if game.Workspace.TimeInMinutes.Value == 360 then Lightsoff() end end end
If i set the value to 1140 it works fine, but does nothing when i set it to 360 Any idea?
local Window = script.Parent.Window local Doorhole = script.Parent.Doorhole function Lightsoff() Window.BrickColor = BrickColor.new("Really black") Doorhole.BrickColor = BrickColor.new("Really black") print("Lights are off") end function Lightson() Window.BrickColor = BrickColor.new("CGA brown") Doorhole.BrickColor = BrickColor.new("CGA brown") print("Lights are on") end while true do wait(.1) if game.Workspace.TimeInMinutes.Value == 1140 then Lightson() end if game.Workspace.TimeInMinutes.Value == 360 then Lightsoff() end end
Put an if statement inside an if statement by accident.