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

Can you change a text from ServerScriptService?

If so, how do you do it? I think I'm missing something. My script is in a textlabel.

I have this as my variable for changing texts

local textLabel = script.Parent

when I place my script in ServerScriptServer the following variable doesn't work

local textLabel = game.StarterGui.ScreenGui.TextLabel

1 answer

✓ Accepted answer

StarterGui is something that clones into the PlayerGui. If you want to geta specific Player's text label do the following:

game.Players.PLAYER_NAME.PlayerGui.ScreenGui.TextLabel

if you want to get all the Players' text labels, do the following:

Players = game.Players:GetChildren()
for i, v in pairs(Players) do
	v.PlayerGui.ScreenGui.TextLabel
end
--It may be Ipairs instead of pairs, I'm not the best with pairs and ipairs

Did this help?

1 comment

0

I'll try it out rn

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