Contents
StatisticsManager class
This class provides a store for various types of player statistics. The store will be read and sent to the client when the Statistics button is pressed.
Member variables
Name | Type | Notes |
Custom |
Map of CustomStatistic to number |
Gets or sets the value of a custom statistic. |
Example usage
Each store is a table, keyed by the statistic that the entry tracks, with value typically representing the number of times the event happened:
function ModifyPlayerFurnaceInteractions(Player)
local Statistics = Player:GetStatistics()
if (Statistics.Custom[CustomStatistic.WalkOneCm] > 10) then
Statistics.Custom[CustomStatistic.InteractWithFurnace] = 1337
end
-- Next time the player presses Statistics they will see the updated value for furnace interactions.
end
|