Hello guys. I've been trying for hours to make a button invisible by having a certain amount of stats inside the "players/playername" folder when the player joins the game, but without any success. Did I do something wrong? Thanks in advance!
Here's the code:
local player = game.Players.LocalPlayer
local lock = script.Parent.lock
game.Players.PlayerAdded:Connect(function()
if player.Powerlevel.Value >= 250 then
lock.Visible = false
end
end)
Sorry, I am pretty new to scripting

1 comment
Is this under leaderstats or what is it under? Name the hierarchy. Like workspace --> Model -- > Part --> WeldConstraint for example