How can I make a script that similar to a light script that turn on at night but for material? Can somebody help me?
This should work. string.sub()
subdivides the string. parameter 1 = string, parameter 2 = first position, parameter 3 = second position (defaults at the length of the string).
local part = game.Workspace.Part while true do wait(1) local l = game.Lighting local h = string.sub(l.TimeOfDay,1,2) if h < 6 or h >= 18 and part.Material ~= "Grass" then part.Material = "Grass" elseif h >= 6 or < 18 and part.Material == "Grass" then part.Material = "Plastic" end end