Mouse Error (attempt to index nil with 'Icon')

Can you please help me fix this. So I was on roblox studio today and was playing with users mouse. I came aross a error. The script: script.Parent.ClickDetector.MouseHoverEnter:Connect(function(player)
local playermouse = player:GetMouse()
print(playermouse)
wait(1)
print(playermouse.Icon)
playermouse.Icon = “rbxassetid://” – Going to put id here
end)
Error was something like: attempt to index nil with ‘Icon’. Can you please help me. :grinning:

Player::GetMouse returns nil on the server because there is no reason for the server to manipulate things only one player will see. There is a property of ClickDetectors called CursorIcon which is the icon that will be used when you hover over a click detector and is reset back to the default mouse icon when you hover away.

1 Like

Oh, I see why now. Thank you. (Char 30)