heres my script
1 | local data = game.Players.LocalPlayer:WaitForChild( 'Data' ) |
2 | local lvl = data:WaitForChild( 'Level' ) |
3 | local lvlvalue = lvl.Value |
4 | game.Players.PlayerAdded:connect( function (player) |
5 | script.Parent.Text = lvlvalue |
6 | end ) |
1 | local player = game.Players.LocalPlayer |
2 | player.PlayerGui:WaitForChild( "ScreenGui" ) |
3 | local LevelText = player.PlayerGui.ScreenGui.TextLabel |
4 |
5 | player.leaderstats.Level.Changed:connect( function () |
6 | LevelText.Text = player.leaderstats.Level.Value |
7 | end ) |
Basically I used the .Changed event to set the text of the textlabel every time your level is changed.
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.
1 | repeat |
2 | wait(. 5 ) -- Refresh |
3 | script.Parent.Text = "" ..game.Players.LocalPlayer.leaderstats.Level.Value.. "" |
4 |
5 | until false |
Please accept answer if works!