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

Change GUI text value on join?

	owner.Stats:WaitForChild("Lvl")
	wait(0.1)
	owner.PlayerGui.mainUI.Frame.pictureHolder.levelValue.Text = ownerStats.Lvl.Value

even without the wait the script doesn't seem to change the text on lvl. However it works on expchanged function when exp is changed, but just not on player connected

already used the player added event

function gamestartlevel()
	local a = "a"
	if a == "a" then
		owner.PlayerGui.mainUI.Frame.pictureHolder.levelValue.Text = ownerStats.Lvl.Value
	end
end

game.Players.PlayerAdded:Connect(gamestartlevel)

on playerstartscripts :( (works on exp changed event just not on playeradded)

tried putting the script inside textlabel but still doesn't work

function starter()
wait(0.1) 
script.Parent.Text = game.Players.LocalPlayer.Stats.Lvl.Value
end

game.Players.PlayerAdded:connect(starter)



4 comments

0

Shouldn’t modify the PlayerGui from the server.

0

tried to put the script inside the levelValue but still doesn't work

0

FE?

0

FE?

1 answer

You can use the PlayerAdded event.

function onPlayerAdded(player)
	--insert code here
end

game.Players.PlayerAdded:connect(onPlayerAdded)

http://wiki.roblox.com/index.php?title=API:Class/Players/PlayerAdded

3 comments

0

already used that game.Players.PlayerAdded:Connect(gamestartlevel) on

0

I'm not really sure what you're trying to accomplish then. You should post that part of your script since it's relevant.

0

i want the text of the gui of a player to be changed on game start, but it doesn't work even with waitforchild

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