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

Why doesnt this ClickDetector script work?

Asked by 9 years ago
01local cd = game.Workspace.Rain.ClickDetector
02cd.MouseClick:connect(function()
03    local m = game.Players.LocalPlayer:GetMouse()
05end)
06 
07local sd = game.Workspace.Rain.ClickDetector
08sd.MouseLeave:connect(function()
09    local m = game.Players.LocalPlayer:GetMouse()
11end)

1 answer

Log in to vote
1
Answered by 9 years ago

What I think is wrong:

I think you need to fix 2 things.

1) The first function has the sound playing on Click, while the other one is when the mouse is leaving. I would say change ".MouseClick" to ".MouseHoverEnter"

2) The second function is telling it do something when a ".MouseLeave" occurs, but that doesn't exist. It should be ".MouseHoverLeave" like in the first one.

Ad

Answer this question