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

How would I make a click script in a part?

Asked by 3 years ago

Hi, so, I want to make a clickdetector script for my game, but I have no idea what to put at the end.

function(clicky)
game.Lighting.TimeOfDay = 0
function:Connect(clicky)

can i get some help on this

2 answers

Log in to vote
2
Answered by
2_MMZ 1059 Moderation Voter
3 years ago

You have only 1 line correct, but two are a bit off. you have to identify it correctly, like this:

function clicky()
game.Lighting.TimeOfDay = 0
print("Time changed. Works!")
end

script.Parent.ClickDetector.MouseClick:Connect(clicky)
Ad
Log in to vote
0
Answered by 3 years ago

I don't understand what you want lol But this is what I think you want

local ClickDetector = --I don't know where did you put your script so fill this in

function clicky()
    game.Lighting.TimeOfDay = 0
end

ClickDetector.MouseClick:Connect(clicky)

Answer this question