So when you click my block, you're suppose to get 1 Click (point) added to yourself on the leaderboard. The problem is that everyone gets a point anytime anyone clicks the block. How can I fix this?
My script:
function OnClick()
local players = game.Players:GetPlayers()
for i=1,#players do
if (players[i]:FindFirstChild("leaderstats") ~= nil) then
local clicks = players[i]:FindFirstChild("leaderstats")["Clicks"]
if (clicks ~= nil) then
clicks.Value = clicks.Value + 1
end
end
end
local f = Instance.new("Fire")
f.Parent = script.Parent.Head
game.Debris:AddItem(f, .2)
end
script.Parent.ClickDetector.MouseClick:connect(OnClick)
