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

Change GUI text value on join?

Asked by 5 years ago
Edited 5 years ago
    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)



0
Shouldn’t modify the PlayerGui from the server. User#19524 175 — 5y
0
tried to put the script inside the levelValue but still doesn't work xxXTimeXxx 101 — 5y
0
FE? User#17685 0 — 5y
0
FE? User#17685 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

0
already used that game.Players.PlayerAdded:Connect(gamestartlevel) on xxXTimeXxx 101 — 5y
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. Perthrosama 24 — 5y
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 xxXTimeXxx 101 — 5y
Ad

Answer this question