I'm trying to figure out how to change the cursor's ID

I’m struggling with a script that is supposed to change the Player’s cursor to any ID when mouse is hovering on a ‘part’.

local plr = game:GetService("Players").LocalPlayer
local mouse = plr.GetMouse()

if mouse.Target:IsA("Part") then
	mouse.Icon = 'rbxassetid://6764432293'

end

Is this a serverscript? Where is it located?
Also you don’t need GetService(“Players”)
All you need is game.Players.LocalPlayer

1 Like
local plr = game:GetService("Players").LocalPlayer
local mouse = plr.GetMouse()

while task.wait() do
if mouse.Target ~= nil and mouse.Target:IsA("Part") then
	mouse.Icon = 'rbxassetid://6764432293'

end
end
3 Likes
game:GetService("Players")

is exactly the same as -

game.Players

The difference is, the first method is better and more efficient.

1 Like

Thanks for the script, it indeed works.