This is the standard leaderboard code.
game.Players.PlayerAdded:connect(function(plr)
local f = Instance.new("Folder", plr)
f.Name = "leaderstats"
local coins = Instance.new("IntValue", f)
coins.Name = "Coins"
coins.Value = 0
end)
Click collect: What should I add to the code to work? the I click, I will earn + 1point/coins for example.
function onClicked()
if model:FindFirstChild("Humanoid") ~= nil then
if model.Humanoid:GetState() == Enum.HumanoidStateType.Dead then
--]] put the code collect points
end
end
button.Regen:Play()
end
button.ClickDetector.MouseClick:Connect(onClicked)
