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

Cant change mouse curser?

So, as you can tell by the code it's trying to change the mouse curser. However, studio says it's unable to change the curser.

The code is running on a local script in a Gui.

Code:

mhid = false
mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key)
	key = string.lower(key)
	if string.byte(key) == 113 then
		if not mhid then
			mhid = true
			mouse.Icon = "http://www.roblox.com/asset/?id=20686724"
		elseif mhid then
			mhid = false
			mouse.Icon = ""
		end
	end
end)

Output: Cannot set Icon of a PlayerMouse

1 answer

✓ Accepted answer

Sadly you cannot use PlayerMouse to change the icon. What you have to do is make a hopperbin/Tool and force equip it then change the icon with that mouse. You can force equip it by using the :EquipTool and then game.StarterGui:SetCoreGuiEnabled(2, false) The SetCoreGuiEnabled makes it so the player cannot unequip the tool.

5 comments

0

Players can unequip a tool using hockeys, even if the backpack CoreGui is disabled.

0

No they can't? If you want to test that then go here: http://www.roblox.com/Realms-place?id=142405423

0

Alright, even though this is disappointing news, i appreciate the help. Thank you.

0

@Articulating: Even if they can unequip it, then just have something checking to see if it isn't selected, and when it isn't, just reselect.

0

Nice answer

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