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

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

Asked by 6 years ago

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

Log in to vote
0
Answered by
oSyM8V3N 429 Moderation Voter
6 years ago
Edited 6 years ago

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

0
Bad answer. :00 cant be called on "17". H4X0MSYT 536 — 6y
0
It must be a string. H4X0MSYT 536 — 6y
0
yeah sorry, fixed it oSyM8V3N 429 — 6y
Ad

Answer this question