I've been asking how to make a part a one time click and even if you leave and come back you can't click it again to get points. I need it to be player specific so other players are still able to click it once. Now, the script isn't adding adding to the players stat (Kirbies Found). If you could tell me whats wrong and tell me how to fix it or show the new script that would be great, Thanks!
local Debounce = {}
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if Debounce[player] then return end
Debounce[player] = true
local stat = player:WaitForChild(“leaderstats”)[“Kirbies Found”]
stat.Value = stat.Value + 1
end)
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player:FindFirstChild(“Kirbie”).Value == true then
return
end
player:FindFirstChild(“Kirbie”).Value = true
local stat = player:WaitForChild(“leaderstats”).[“Kirbies Found”]
stat.Value = stat.Value + 1
end)
end)

1 comment
Don´t repost your questions. Be patient.