Description
Adds a value to a player's statistic.
Arguments
1Player ply
- The player it is given to.
2string statName
- The statistic's name.
3number value
- The number to be added.
Example
Give the player statistics for every letter they write.
lua
hook.Add("PlayerSay", "CountLetters", function(ply, text )
if ply:Alive() and text:len() > 0 then
stats.Add(ply, "letters", text:len())
end
end)