1 | local player = game.Players.LocalPlayer |
2 | local level = player.leaderstats.Level |
3 |
4 | if level.Value > = 1 |
5 | then player.PlayerGui.ScreenGui.TextButton.Visible = true |
6 | else player.PlayerGui.ScreenGui.TextButton.Visible = false |
7 | end |
this code is supposed to let the player see the button only after he reaches LVL.1 but it doesn't show it even after he reaches LVL.1
Try this:
1 | local player = game.Players.LocalPlayer |
2 | local level = player:WaitForChild( "leaderstats" ):WaitForChild( "Level" ) |
3 | while true do wait() |
4 | if level.Value > = 1 |
5 | then player.PlayerGui.ScreenGui.TextButton.Visible = true |
6 | else player.PlayerGui.ScreenGui.TextButton.Visible = false |
7 | end |
8 | end |
01 | --// I believe it would look more along the lines of this |
02 | local player = game.Players.LocalPlayer |
03 | local level = player.leaderstats.level |
04 | level.Changed:connect( function () |
05 | if level.Value > = 1 then |
06 | player.PlayerGui.ScreenGui.TextButton.Visible = true |
07 | elseif level.Value < 1 then |
08 | player.PlayerGui.ScreenGui.Textbutton.Visible = false |
09 | end |
10 | end |