Its still doesn't work, I put it in the text button and still its doesn't work. what do I do wrong? What I'm trying to make the script do is to remove the text button with the word "Unlock" labeled in the text button from the image button when a player have 10 points or higher. I want the text button to remove, so the player can see the image button when they have 10 points or higher. I just want the text button to remove when a player reach the requirement points. Please check the link below to see what I'm talking about.
But please check this screen shot that i took, so you can see what i'm talking about:
Also here is the script if you need to check:
local player = game.Players.LocalPlayer
repeat wait() until player.Character -- So no errors occur later on ;)
local stats = player:WaitForChild('leaderstats')
local statsname = "Points"
local guiname = "ScreenGui"
stats[statsname].Changed:connect(function()
print('Changed')
if stats:FindFirstChild(statsname) then
print('IT EXISTS!')
if stats[statsname].Value >= 10 then -- If the value is more than or equals to 10 then do:
print('VALUE EQUALS 10!')
if player:WaitForChild('PlayerGui'):FindFirstChild(guiname) then
print('found the gui')
player.PlayerGui[guiname]:Destroy()
end
end
end
end)

1 comment
You could however add already the IntValue named "Points" in the leaderboard so that you won't have to be pressured on a long line of code here. Hope this helps :)