Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I fix this onClicked script about the time of day?

Can anyone here explain why this won't work? I'm making a script that changes the time of day when clicked.

Button1 = script.Parent

function onClicked(Button1)

	script.Parent.Parent.Lighting.TimeOfDay = 17

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

✓ Accepted answer

You can't change the time of day to 17, it goes in 00:00:00 format. So your script should be written like this :

local Button1 = script.Parent

function onClicked(Button1)

    game.Lighting.TimeOfDay = "17:00:00" -- 00:00:00 format

end

script.Parent.ClickDetector.MouseClick:Connect(onClicked)

If you have any other questions, please let me know

--oSy

3 comments

0

Bad answer. :00 cant be called on "17".

0

It must be a string.

0

yeah sorry, fixed it

This discussion is preserved as it was. New answers, comments, and votes are closed.