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

How come MouseIconEnabled doesn't work?

Ok so I recently found out that my scripts that use MouseIconEnabled have stopped working, and I even wrote up a simple script to test the property to make sure it wasn't a problem with my scripts, and sure enough, that still didn't work. Any ideas on why this may be?

Here's the test code:

while true do
	wait(2)
	Game:GetService("UserInputService").MouseIconEnabled = false
	wait(2)
	Game:GetService("UserInputService").MouseIconEnabled = true
end

NOTE: This code is being run from a localscript inside the PlayerGui, so there's no way it shouldn't work

Thanks

1 answer

Okay, so I found a fix. First off, this HAS to be a LocalScript. Next, what happened for me when testing it was that it didnt work in studio, but then I tested it just hitting Play and it worked.

3 comments

0

You are correct that it needs to be in a LocalScript and doesn't work in Studio, but it does not have to be in the StarterGui to work -- any LocalScript that runs regardless of where it is parented to can toggle MouseIconEnabled.

0

Ah, my bad.

0

this code is in a localscript, but are you saying that it doesn't work in Play Solo mode?

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