Mouse icon working in roblox studio but not in-game

  1. I need to fix this so I can have a working cursor.

  2. roblox studio works for mouse cursor but not in game

  3. I’ve changed the icons size to 256x256, I’ve tried using mouse icons already uploaded, I’ve used the actual assetid and not the library id, I’ve tried making a GUI frame but that failed because the cursor was out of line with the mouse.

local script:

local Camera = game.Workspace.CurrentCamera
local mouse1 = game.Players.LocalPlayer:GetMouse()
local Eq = false

function Equipped()
	local mouse = game.Players.LocalPlayer:GetMouse()
	mouse.Icon = "http://www.roblox.com/asset?id=9834486087"
	print("Changed!")
	Camera.FieldOfView = 65
	Eq = true
	--change icon
end

function Unequipped()
	mouse1.Icon = "rbxasset://SystemCursors/Arrow"
	Camera.FieldOfView = 70
	Eq = false
	--change icon to normal cursor
end

mouse1.Changed:Connect(function()
	local mouse = game.Players.LocalPlayer:GetMouse()
	if Eq == false then return end
	if not 	mouse.Icon == "http://www.roblox.com/asset?id=9834486087" then
		mouse.Icon = "http://www.roblox.com/asset?id=9834486087"
		print("Changed!?!?!?!")
	end
	print(mouse.Icon)
end) --- if icon is changed to normal then fix back to crosshair

script.Parent.Equipped:Connect(Equipped)
script.Parent.Unequipped:Connect(Unequipped)

Make sure you published the updates to the game, and that your tool has a handle. If you don’t want your tool to have a handle turn off the property “RequiresHandle” on your tool. It will block some events on the tool if your tool doesn’t have a part in it named “Handle”.

Also set the mouse icon to an empty string inside the “Unequipped” function, otherwise you will still have the Arrow icon as your mouse even if you hover over buttons.

function Unequipped()
	mouse1.Icon = ""
	Camera.FieldOfView = 70
	Eq = false
	--change icon to normal cursor
end

Tools Requiredhandle is already turned off, if you test the script I made you will see that it prints when it is equipped and everything. game is published too plus the only problem really is the icon but thanks for the help.

Yeah I tested your script in studio with RequireHandle turned off, and it works fine for me. So it might just be roblox jank or someting.

Also, it might be another scripts in your game interfering, check the console by pressing F9 ingame and open client tab. Check if it prints “Changed” there, if it does but nothing changes it might just be a script interfering. Do you have some sort of anti cheat in your game that could be preventing it?

it prints change yes, but I checked and have no scripts which interfere.

One more detail, it’s supposed to print the mouse icon when it’s changed but doesn’t when it’s equipped.

now it does but still having the same issue


(NOTHING MESSES WITH THE ICON OTHER THAN THE TOOL ICON SCRIPT WHICH I NEED HELP WITH)

One more detail: the game is uploaded to a group and so is the icon, but don’t know if this affects anything.

Just figured out it does not work for any icon changing script in my game.

  • I tested a script in StarterGui to change the mouse icon on join and in roblox studio it worked but not in-game on the actual roblox website.

(Neither do different mouse icons work.)

Any fix??

Fixed, all I needed to do is go into photoshop and change the images size to 256x256, there was a slight mistake and I typed in 266 instead.

1 Like

Ah, nice you got it working. I was away for a few days, so I couldn’t help.

I have the exact same issue regarding Mouse.icon not working in the actual roblox client. Except, whenever I changed my icon to 256x256, it made the cursor massive.

2 Likes