Light = game.Workspace.Lamp.LightPart Time = 0 while true do Time = Time+4 game.Lighting:SetMinutesAfterMidnight(Time) wait(.1) if game.Lighting:GetMinutesAfterMidnight == 6 * 60 then Light.Material = Enum.Material.Plastic Light.PointLight.Enabled = false end if game.Lighting:GetMinutesAfterMidnight == 18 * 60 then Light.Material = Enum.Material.Neon Light.PointLight.Enabled = true end end
That's the code I'm using to turn a lamp on and of at certain times in the day but in the first "if then" statement "==" cause an error because it expects a ( or { how do I fix this (And yes the is the Wiki's Tutorial day/night script).
You need to write "GetMinutesAfterMidnight()" because it is a function, and you always put open and close brackets after the name when calling it. Inside the brackets, you would pass it an argument (Either nothing or Time in your case), so the function knows what its doing.