Brick won't delete itself when the player has enough XP, any ideas?
I have a game where you advance to the next level by earning XP and when you have the designated amount of XP a part will be destroyed so you can go through it (Client sided).
I believe that it should work but I get no printed text etc. No error either.
LOCAL SCRIPT:
01 | local plr = game:GetService( "Players" ).LocalPlayer |
03 | local function CheckIfEnough() |
05 | if plr:WaitForChild( "leaderstats" ).XP.Value > = 500 then |
07 | script.Parent.Parent.NextLevelBrick:Destroy() |
12 | plr:WaitForChild( "leaderstats" ).XP.Value.Changed:Connect(CheckIfEnough() |