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
local cd = game.Workspace.Rain.ClickDetector
cd.MouseClick:connect(function()
    local m = game.Players.LocalPlayer:GetMouse()
    m.Icon = "http://www.roblox.com/asset/?id=241876428"
end)

local sd = game.Workspace.Rain.ClickDetector
sd.MouseLeave:connect(function()
    local m = game.Players.LocalPlayer:GetMouse()
    m.Icon = "http://www.roblox.com/asset/?id=30656108"
end)

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