I'm trying to make this script remove the text button when the player have collected 10 coin or more, but it doesn't work. Did I put it in the wrong script? What did I do wrong? Can you guys help me?
You can look at this screen shot if you would like to see: http://prntscr.com/8lnoym
If you want the model, I can give it to you. So you could have a better of understanding:
http://www.roblox.com/My/Item.aspx?ID=311894614
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local stats = player:WaitForChild('leaderstats')
local statsname = "Points"
local guiname = "Unlock"
stats[statsname].Changed:connect(function()
print('Changed')
if stats:FindFirstChild(statsname) then
print('IT EXISTS!')
if stats[statsname].Value >= 10 then
print('VALUE EQUALS 10!')
if player:WaitForChild('PlayerGui'):FindFirstChild(guiname) then
print('found the gui')
player.PlayerGui[guiname]:Destroy()
end
end
end
end)
Many thanks, my friends!

11 comments
I tested it and it doesn't work. Can you check if I made some error mistakes?
I updated the model so you can check it.
I updated my code, I explained what the problem was on the update
Thank you, my friend! 1 Point for you!!! :)
But there's is still one problem. When I reset, the text button come back. So I have to collect all the coins again for it to remove. Is there a way to make it remove permitted without having to collect it again when I reset?
I updated the model again, so you can check it.
I updated my code again, and you're welcome man
Ummm, can you help me again? I don't know how to explain this but I make a team selection for my sonic GUI and my text button isn't removing when I collected the coins. Again, I'm sorry to bothered you again. Can you help me? Please. D:
I updated the model again, so you can check it out.
Here is the link to the model: http://www.roblox.com/unnamed-item?id=313163376
Please, if you're online. :(