Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

is there a script to change players mouse icon to the same image for all ClickDetectors in the game?

hey... so im working on a horror game, and i wanted to change the players cursor to a simple black dot, and then once they hover over ANY ClickDetector, then it would change to a simple hand icon, and then back again once it is NOT hovering over a ClickDetector.

im not fantastic at scripting, and im honestly suprised there is no easier way to change such a practical thing, but Roblox do what Roblox do...

any help would be great.

1 answer

You can try these 2 local scripts I use, of course replace ""whatever"" with the Asset ID you need. You'll need to put them into StarterGUI.

function Search(ItemToSearch)
    for i, v in pairs(ItemToSearch:GetChildren()) do
        if v:IsA("ClickDetector") then
            v.MouseHoverEnter:connect(function(Player)
                local Mouse = Player:GetMouse()
                Mouse.Icon = "whatever"
            end)
            v.MouseHoverLeave:connect(function(Player)
                local Mouse = Player:GetMouse()
                Mouse.Icon = "whatever"
            end)
        end
        Search(v)
    end
end

Search(workspace)

I don't know if a professional would recommend this, but atleast it works for me.

local mouse = game.Players.LocalPlayer:GetMouse()

local texture = "whatever"

mouse.Icon = "whatever"

4 comments

0

Thanks dude! The first script should work just fine, im just suprised Roblox hasn't made it easier to change both so that they work together, instead of one permanently staying the mouse icon.

0

The second script changes the cursor from the start.

0

And the two "whatever"s in the first script are 2 icons which you need to place.

0

it works perfectly! thanks dude, i spent a good 2 hours tryina get it to work before.

This discussion is preserved as it was. New answers, comments, and votes are closed.