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

I am trying to have a part change material during the night. Why isnt the Part changing Material?

Asked by 5 years ago

This code is in a server script and I want the part to change when It is night time. and metal material when it is day.

while true do
local timeofday = tonumber(game.Lighting.ClockTime)
if timeofday >= 18 or timeofday <= 6 then
        game.Workspace.Part.Material = Enum.Material.Neon
elseif timeofday <= 18 and timeofday >= 6 then
        game.Workspace.Part.Material = Enum.Material.Metal

end
wait()
end

0
Not able to test currently but your code is trying to make the part 2 different material types at both 18 and 6, you need to change your elseif to <18 and >6. DinozCreates 1070 — 5y
0
when the time changes the material isnt changing OnlineSaiyan 28 — 5y
0
Could you be more descriptive of your issue User#19524 175 — 5y

Answer this question