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

The script won't change the text twice?

It only changes one, and when I put a print, it works, but it doesn't change the text.

local label = game.StarterGui.waitGui.waitFrame.waitLabel

game.Players.PlayerAdded:connect(function(plr)
	label.Text = "Welcome, "..plr.Name..", to WIP, an unfinshed game."
	wait(2)
	--if I put print here, the print works, but still doesn't change the text.
	label.Text = "0"
end)

1 answer

✓ Accepted answer

You are modifying the StarterGui which isn't gonna change the player view, but the servers view. You need to do this:

  1. move the variable to where it can be changed to the players PlayerGui.

  2. Modify, after the player is loaded

Basically this:

game.Players.PlayerAdded:connect(function(plr)
    repeat wait() until plr:WaitForChild("PlayerGui") -- This waits for the GUI's for the player to load
    local label = plr.PlayerGui.StarterGui.waitGui.waitFrame.waitLabel  -- This goes into the PlayerGui and modifies his view
    label.Text = "Welcome, "..plr.Name..", to WIP, an unfinshed game."
    wait(2)
    label.Text = "0"
end)

1 comment

0

Thank you.

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