How to change mouse icon

Hello I’m trying to change the mouse’s icon.

right now I have:

mouse.Icon = "9126971632"

This works… barely. The mouse keeps changing back to the default mouse randomly and when the mouse hovers over a button it goes back to pointer.

I want the mouse to ALWAYS be the icon image no matter what.

example of it working (randomly)
image

then randomly it stops being the shooter icon

local icon_id = '9126971632'

mouse.Icon = icon_id 
mouse:GetPropertyChangedSignal('Icon'):Connect(function()
	if mouse.Icon ~= icon_id  then
        mouse.Icon = icon_id 
    end
end)

i tried it and it still is not working :frowning:

image

in fact, for some reason, now it NEVER works. The mouse used to change but now it NEVER changes to the shooter icon

what if you changed it to just this;

mouse.Icon = 'rbxassetid://9126971632'

local mouse = game:GetService('Players').LocalPlayer:GetMouse()
local icon_id = 'rbxassetid://9126971632'

mouse.Icon = icon_id
mouse:GetPropertyChangedSignal('Icon'):Connect(function()
	if mouse.Icon ~= icon_id  then
		mouse.Icon = icon_id 
	end
end)

the above code worked for me and should ENSURE it stays

7 Likes

that works but your event never fires

local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
mouse.Icon = "rbxassetid://9126971632"
end)

Try this.

this is bad for optimization, Isn’t it?

Try what I just added to mine, it should work now

Nope, It shouldn’t be if you add an if check to see if the mouse icon is that already. Plus it doesn’t lag that much.

your getpropertychangedsignal event never fires. i tested with print, it never fires.

also i tested with the correct ID and it still never fires

Then to be honest, I can’t help any further without doing something similar to what @LambHubGoBrrrrr is doing, I’d try his because that SHOULD work

local RunService = game:GetService(“RunService”)
RunService.RenderStepped:Connect(function()
if mouse.Icon ~= “rbxassetid://9126971632” then
mouse.Icon = “rbxassetid://9126971632”
end
end)

This is to make the perfomance better.

Your solution doesn’t work either. I tried it and i hovered over a button, and the mouse gets changed to the select mouse icon.

That always happens, there is no way around it I think.

You could also try this :
If it has an error I didn’t test in studio I wrote this in the devforum.

mouse.Changed:Connect(function()
if mouse.Icon ~= “rbxassetid://9126971632” then
mouse.Icon = “rbxassetid://9126971632”
end
end)

i found “Sort of” a solution. by disabling active it makes the mouse not change when hovering over buttons but it still changes when it clicks. This is fine. Also i can tell you’re on mobile lol by your fancy apple parenthesis

apple parenthesis: ”
Normal parenthesis: "

That is also a solution but you are wrong I am not on mobile.

You’re not using a keyboard then

I am using a keyboard by the way it just happens when you are not writing the script in studio.