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

"ScreenGui is not a valid member of PlayerGui." It definitely is. ???

I am making a sandbox game in roblox where players can make their own obby. I have come across an EXTREMELY outrageous and frustrating glitch in my game that in the developer console, it says "ScreenGui is not a valid member of PlayerGui," even though i can still see all the other descendants of that same screengui on my screen. It works in studio but not in Roblox player. This is definitely the most frustrating and confusing glitch i've ever came across. When I use WaitForChild("ScreenGui") it says "Infinite Yield Possible" and never runs the script.

Edit:

Here's the scripts im using:

In a model (Regular Script):

part = script.Parent

function configure(player)
	if player.Team.Name == part.Parent.Parent.Name then
		player.PlayerGui.ScreenGui.EditObject.Object.Value = part
	end
end

part.ClickDetector.MouseClick:connect(configure)

in a TextLabel in a Descendent of ScreenGUI (LocalScript):

while true do
function updateText()
	if script.Parent.Parent.Object.Value then
		script.Parent.Text = script.Parent.Parent.Object.Value.Name
	end
end

wait()

updateText()
end

4 comments

0

I have already answered this, it means that ScreenGui doesn't exist. Check if you have duplicates of 2 screenGuis and also make sure you name them.

0

If :WaitForChild() says Infinite Yield it means it doesn't exist

0

ScreenGui does exist, and it has no duplicates.

0

it works in studio but not in Roblox Player.

1 answer

✓ Accepted answer

If your game is FilteringEnabled (experimental mode off), then what you are facing is not a glitch but rather an intended characteristic of FE: The server is unable to access client-only services directly (the PlayerGui, for instance). So in order to make your script work, you will need to use RemoteEvents. Specifically, make use of the FireClient() function in your server script.

Have a good day!

1 comment

0

How do i do this? I am new to FilteringEnabled.

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