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

Is there anyway to prevent the mouse GUI cursor from showing up in-game?

So I have a basic script that will change a local player's mouse icon to a url/decal like so:

local c = script.Parent.Cursor
local p = game:GetService("Players").LocalPlayer
local m = p:GetMouse()
while true do
	if m.Icon ~= c.Image then
		m.Icon = c.Image
	end
	wait()
end

Cursor (referenced as local variable c) is an imageLabel in case there is any confusion, the local script is also in the starterGui. And this local script works fine, however whenever a player hovers his or her mouse on an actual gui in-game, the mouse cursor changes to the black roblox 2016 GUI cursor (https://t7.rbxcdn.com/e11c6baf10eb4b67dc01cc9e32c74c73). Whenever the player's mouse leaves the gui, it goes back to the image in Cursor.Image like normal. BUt what I am wondering is if there is anyway to stop the black gui cursor from appearing whenever you hover your mouse on a gui, and instead keep the cursor as Cursor.Image.

2 answers

This is not needed. Just use this simple script!

game.Players.PlayerAdded(function(plr)

plr:GetMouse().Icon = 'IMAGE NAME HERE'

end)

That was simpler than you thought! It is only 6 lines of code! So lets explain what I did. So :GetMouse() is, well, getting the player's mouse! Icon is, well, getting the image! A example code.

game.Players.PlayerAdded(function(plr)
plr:GetMouse().Icon = 'rbxassetid://123456' --Just so you know, 123456 is not a valid ID.
end)

2 comments

0

Oops, forgot to mention when grabbing the ID, subtract 1 from the digit. For example, if the ID is 544544, then it would be 544543

0

I already did that, my problem is that the mouse Icon is overridden when it hovers over a gui. Thanks for trying to help tho.

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