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

Control a Player GUI?

So, i have a game in which there is a 1-person server. I want to control the PLAYERS GUI not the starter one. I am an intermediate scripter so fell free to speak in heavy scripter talk. Oh yeah and i checked all the wiki articles on GUIs and I couldn't find it.

1 comment

0

player.PlayerGui

1 answer

✓ Accepted answer

Since everything in StarterGui is cloned into a player's PlayerGui each time they respawn, to edit what the player is currently seeing you must make your changes to the PlayerGui.

game.Players.Player.PlayerGui:ClearAllChildren() --Removes all GUIs a player is currently seeing. 

4 comments

0

So then you would use the StarterGUI to add a gui?

0

In studio, yes. If you create a GUI in StarterGui while the game is running, however, players would not be able to see it until they respawned,

0

Ok so if you're answer is correct you could do: game.Players.Player.PlayerGui.ScreenGUI.TextLabel.Text = "Hello"

0

Yes, that would work (assuming someone's name is 'Player'). If you want to edit all the players, use a for loop. For example, 'for i,v in pairs(game.Players:GetPlayers()) do print(v.Name) end'

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