I have a ScreenGui in StarterGui called OreBar. One of my scripts has to access this. When ever I try, it fails, giving me error saying it cannot find OreBar. All the other scripts that access this work fine.

It works in studio, but not in the actual game.

Line 4 does not work: PlayerGui:WaitForChild("OreBar", 20) It gives errors only in game, not studio.

It is being accessed from a script in workspace.Ores

Why can only this one script not access it, but ALL others can?

4 comments

0

I'm guessing all the other scripts that work are local scripts, while the game is FE, correct?

0

yes

0

If your script is not a LocalScript in the player and is located somewhere like ServerScriptService, the problem is that the server cannot access the player while Filtering is enabled.

0

Thank you, but is there a way to do this still without disabling filtering