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

How should I change a TextLabel's text through a script?

In a local script I tried to use something like:

ChangeGui.OnClientEvent:Connect(function(gui, frame, label, text)
	PlayerGui[gui][frame][label].Text = text
end)

then in another script in serverscriptservice to start the GUI change:

local invon = game.StarterGui.Back.On

if invon == 1 then
	ChangeGui:FireAllClients("Back", "LevelFrame", "LevelText", "Changing")
end

Does anyone know why this isn't working?

1 answer

With your script, you are only editing the StarterGui. This is the folder that replicates your own GUIs and parents them to the player for them to see it. The problem is that editing StarterGui with a script won't affect the PlayerGui, so you should edit your script and find some way to read "invon" to continue your script.

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