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)
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