I'm trying to make a script that makes a gui appear only if a player has surpassed a certain leaderstat, this is the code I have so far and there's nothing wrong with the Parents or anything like that so I can't find my error, any help?
player = script.Parent.Parent.Parent.Parent
stats = player:WaitForChild("leaderstats")
Level = stats:WaitForChild("Level")
game.Players.PlayerAdded:connect(function()
if Level.Value >= 50 then
script.Parent.Visible = true
end
end)

4 comments
BTW the parent is a frame so the visible = true should work
The script in which this code resides probably loads after the player has been added to the game, so the PlayerAdded event won't fire. I'd suggest putting this in a LocalScript and doing the level check directly rather than waiting for an event.
How would I do it directly, can you give an example using my code?
I think I see it, look at what I write and see if it works