Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How come MouseIconEnabled doesn't work?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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.

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. EchoReaper 290 — 9y
0
Ah, my bad. CheekySquid 78 — 9y
0
this code is in a localscript, but are you saying that it doesn't work in Play Solo mode? TurboFusion 1821 — 9y
Ad

Answer this question