So I'm quite new to lua, but I've had some experience. I came across this
game.Players.PlayerAdded:connect(function(player)
stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
points = Instance.new("IntValue", stats)
points.Name = "Points"
points.Value = 0
end)
script.Parent.Part.Touched:connect(function(hit)
for i, v in pairs(game.Players:GetPlayers()) do
if v == hit.Parent then
points.Value = points.Value + 10
end
end
end)
It's supposed to add points to the leaderboard when each player touches a part. So in other words, it loops around all the players that are in the server, and if it's the right player, it gives him 10 points. But it doesn't seem to add points. Did I do something wrong? And if there's something that could be done to make it better, I'd be happy to know.
Regards, Techadox.

1 comment
Persnally, I think you should use GetPlayerFromCharacter & Debounce (http://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayerFromCharacter & http://wiki.roblox.com/index.php?title=Debounce)