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

Can you change a text from ServerScriptService?

Asked by 6 years ago

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

Log in to vote
1
Answered by 6 years ago

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?

0
I'll try it out rn GIassWindows 141 — 6y
Ad

Answer this question