What I'm trying to make the script do is to remove the text button from the image button when a player have 10 points or higher. But the text button is in the image button. I just want the text button to remove when a player have 10 point or higher. Can you guys help me?
Here is the script that someone have helped me:
wait(1)
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("leaderstats")
local statname = "Points"
local guiname = "ScreenGui"
stats:WaitForChild(statname).Changed:connect(function()
if stats:FindFirstChild(statname) then
if stats:FindFirstChild(statname).Value == 10 then
if player:WaitForChild("PlayerGui"):FindFirstChild(guiname) then
player.PlayerGui:FindFirstChild(guiname):Destroy()
end
end
end
end)
Thank You For Your Time!

2 comments
Is this in a LocalScript, like it's supposed to be?
Yes, But It's Doesn't Work.