I'm really confused and I am very clueless as to how to do it.
So what I want is to be able to change a text using a server script, with the script being in ServerScriptService.
I'm really confused and I am very clueless as to how to do it.
So what I want is to be able to change a text using a server script, with the script being in ServerScriptService.
ServerScriptService does not change anything, it just makes it inaccessible from local scripts for secure storage.
(change ROBLOX to the player)
game.Players.ROBLOX.PlayerGui.ScreenGui.TextLabel.Text = "Hello"
Or use:
game.Players["ROBLOX"].PlayerGui.ScreenGui.TextLabel.Text = "Hello"
Or:
game.Players:FindFirstChild("ROBLOX").PlayerGui.ScreenGui.TextLabel.Text = "Hello"
To loop through all players, use this:
for _,v in pairs(game.Players:GetChildren()) do
v.PlayerGui.ScreenGui.TextLabel.Text = "Hello"
end
(asked in comment)
Thanks for reading, hope it helped!
This Is Better To Do:
Game.Startergui.(ScreenGuiName).(Frame Name).(TextName).Text = "Text"
wait (4)
repeat
That will not update for players. That will update when somebody respawns or joins however.
And that is not how to use repeat.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
How would I change the text of every player?
Do a for loop through every single player, running that code. Use 'v' as the player. Look here: https://scriptinghelpers.org/questions/8097/all-players-in-game-loop
Thanks dude!
No problem.