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

How do I make a GUI text change within the game?

Asked by 4 years ago

I'm trying to do a draft for a league and I want to be able to edit the GUI in-game, so for instance say I have a board and a player gets drafted I want to be able to change the GUI text at the moment inside the game, so it would switch from "Player" to the players name. I have a good example however I can't post links. How can I do this?

1 answer

Log in to vote
1
Answered by 4 years ago

You simply need to set the text property of the TextLabel within the Gui where you want the player's name to show up. For example:

local player = game:GetService("Players").LocalPlayer

player.PlayerGui.ExampleGui.ExampleLabel.Text = "Hello." --Will set the example label under the example gui to Hello.

Text can be set to anything as long as it's a string or a number. All you'll need to do is grab the player and utilize their name.

Ad

Answer this question