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

How do you get the PlayerGui in players?

So I have this

	players = game.Players:GetChildren()
		count = game.StarterGui.countdown
		counting = count:Clone()
		counting.Parent = players.PlayerGui
	
	wait(.5)
		players.PlayerGui.countdown.Frame.Visible = true 

countdown is a Gui that I want to be visible when it activates. So uh, am I doing it right?

1 answer

✓ Accepted answer

Your code was a bit off.

You need to add a for loop to check all the players.

players = game.Players:GetChildren()
for index, value in pairs(players) do --Special function that checks all children of the players
    count = game.StarterGui.countdown
    counting = count:Clone()
    counting.Parent = value:WaitForChild("PlayerGui")--Waits for the PlayerGui to load
    value:WaitForChild("PlayerGui").countdown.Frame.Visible = true 
end

If you are still unclear visit this wiki page: http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions&redirect=no#pairs

3 comments

0

Still doesn't seem to be working... This is what the output says,

0

What does the output say? I edited an error I made in the script, it should work.

0

Whoops! What you wrote was correct! Thank you and sorry :>

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