Mouse.Icon doesnt seem to want to work

I’m attempting to change the Mouse.Icon to a different decal, however it doesn’t seem to want to work.
I’ve made sure the mouse instance is detected in the variable, I also decided to try printing the mouse icons assetid after trying to change it to the new icon, and it did print the decal that I am trying to set it as, however the new icon does not appear on the players screen.

The script is a local script and it’s in the StarterPlayerScripts folder.

Here’s the script (note: it also contains the setting of the running animations sound also)

local plr = game.Players.LocalPlayer

local mouse = plr:GetMouse()

plr.CharacterAdded:Connect(function(char)
	local hum = char:WaitForChild("Humanoid")
	local hrp = hum.Parent.HumanoidRootPart
	local run = hrp.Running
	
	local dist = Instance.new("ReverbSoundEffect")
	dist.Parent = run
	
	run.Volume = 0.3
	run.PlaybackSpeed = 0.78
	
	
while wait() do
		run.SoundId = 'rbxassetid://510934212'
		mouse.Icon = 'rbxassetid://5438996052'
	end
end)

print(mouse.Icon)

Any help is appreciated, thank you :slight_smile:

1 Like
local UserInputService = game:GetService("UserInputService")

local plr = game.Players.LocalPlayer

local mouse = plr:GetMouse()


UserInputService.MouseIconEnabled = true

plr.CharacterAdded:Connect(function(char)
	local hum = char:WaitForChild("Humanoid")
	local hrp = hum.Parent.HumanoidRootPart
	local run = hrp.Running
	
	local dist = Instance.new("ReverbSoundEffect")
	dist.Parent = run
	
	run.Volume = 0.3
	run.PlaybackSpeed = 0.78
	
	
while wait() do
		run.SoundId = 'rbxassetid://510934212'
		mouse.Icon = 'rbxassetid://5438996052'
	end
end)

print(mouse.Icon)
1 Like

I just tried putting it into studio, however it still doesn’t change the icon, but thank you for trying though :slight_smile:

I’m assuming it’s probably something to do with how the mouse cursor changes when it hovers over a GUI, however it still doesn’t change when I change the default icon in one of the playermodules

oh yea i notice that when you go on a guiobject the mouse icon changes

1 Like

you need to change this to use the image id not the decal id

'rbxassetid://5438996031' – this is your image id to get this you can just take the decal id you have and post it into an decal or imagelabel in studio and it will change the id into the image id

2 Likes

What does this while loop do exactly?

1 Like

not sure i just kept it there; i think they are using the while loop so that when they go over a gui object it also changes

The while loop was just put in place to make sure the things I set don’t get changed back which sometimes happens or has happened, basically it’s just temporary to try to limit the amount of things that could be causing it not to set the mouse icon

I’ll quickly give that a go, if it works thank you and I’ll set your comment as the solution

1 Like

Thank you so much lol, I had a feeling it was probably a stupid mistake on my behalf.

1 Like

nah its just a weird way the old roblox systems work they have kinda pieced it together over the years

2 Likes

and yeah you probably don’t need this while loop like Cheater is referring too

1 Like

Yeah I just put it there just in case roblox was doing something shady that I didn’t know about lol, I removed it now though.
Thanks for your help again :slight_smile: