heres my script
local data = game.Players.LocalPlayer:WaitForChild('Data')
local lvl = data:WaitForChild('Level')
local lvlvalue = lvl.Value
game.Players.PlayerAdded:connect(function(player)
script.Parent.Text = lvlvalue
end)
heres my script
local data = game.Players.LocalPlayer:WaitForChild('Data')
local lvl = data:WaitForChild('Level')
local lvlvalue = lvl.Value
game.Players.PlayerAdded:connect(function(player)
script.Parent.Text = lvlvalue
end)
local player = game.Players.LocalPlayer
player.PlayerGui:WaitForChild("ScreenGui")
local LevelText = player.PlayerGui.ScreenGui.TextLabel
player.leaderstats.Level.Changed:connect(function()
LevelText.Text = player.leaderstats.Level.Value
end)
Basically I used the .Changed event to set the text of the textlabel every time your level is changed.
thanks but it doesn't work initially. I need to change the level manually then it will start working. any fix?
on line 4 you can just paste: LevelText.Text = player.leaderstats.Level.Value
This is a local script inside of the Text Label (I recommend Text Label not Text Box if you want it to show player's stat). It is very simple.
repeat
wait(.5) -- Refresh
script.Parent.Text = ""..game.Players.LocalPlayer.leaderstats.Level.Value..""
until false
Please accept answer if works!
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
I'm guessing that the connection to the PlayerAdded event is completely unnecessary. Also, you might want to update it automatically whenever lvl changes, with the .Changed event.
thanks