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

how to replace default mouse icons?

Asked by 6 years ago

I know that you can replace the mouse icon but does anyone know the one used for a click detector or how I could find it? this is my script so far but i need it's decal ID

local mouse = game.Players.LocalPlayer:GetMouse()
if mouse.Icon == 'rbxassetid://(click detector ID here)' then
    mouse.Icon = 'rbxassetid://163023520'
end

1 answer

Log in to vote
1
Answered by
ABK2017 406 Moderation Voter
6 years ago
Edited 6 years ago

You could use the MouseHoverEvent...Keep in mind this is a local script/client side so you’d have to add a remote event to communicate with the server.

local clickDetector = LOCATION_OF_CLICKDETECTOR
local icon = "rbxassetid://ASSET_ID"

clickDetector.MouseHoverEnter:Connect(function(player)
    local mouse = player:GetMouse()
    mouse.Icon = icon
end)

clickDetector.MouseHoverLeave:Connect(function(player)
    local mouse = player:GetMouse()
    mouse.Icon = "rbxasset://textures/ArrowFarCursor.png"
end)
0
MouseHoverLeave has a player parameter, should be done on the server ¯\_(?)_/¯ User#19524 175 — 6y
Ad

Answer this question