Skip to main content

Increment

Increments a value by the given amount. It only works on number type variables.

Parameters:

NameTypeDescription
playerplayerThe player whose data we want to access
pathstringThe path to the user data
amountnumberThe amount that we wish to increment into the value

Returns:

NameTypeDescription
void

Example:

local ServerScriptService = game:GetService("ServerScriptService")
local ProStore3 = require(ServerScriptService.ProStore3)

ProStore3.PlayerJoined:Connect(function(player : Player)
print(ProStore3.Get(player, "Level")) -- Output: 1
ProStore3.Increment(player, "Level", 2)
print(ProStore3.Get(player, "Level")) -- Output: 3
end)