Can anyone tell me how to change the player's cursor back to normal? The error I keep getting with the code below is attempt to index local 'mouse' (a nil value)
on line 8. I've also tried Mouse.Icon = ""
but that doesn't work either.
Code I've tried using:
local Tool = script.Parent Tool.Equipped:connect(function(Mouse) Mouse.Icon = "http://www.roblox.com/asset/?id=131581677" end) Tool.Unequipped:connect(function(Mouse) Mouse.Icon = "http://www.roblox.com/asset/?id=0" end)
Any help appreciated.
Unequipped
doesn't pass the Mouse to listening functions while Equipped
does. You want to use the :GetMouse() function.
local Tool = script.Parent Tool.Equipped:connect(function(Mouse) Mouse.Icon = "http://www.roblox.com/asset/?id=131581677" end) Tool.Unequipped:connect(function() game.Players.LocalPlayer:GetMouse().Icon = "" -- Also, use an empty string here so that it doesn't cause any unnecessary errors end)