Exports

This exports are server side, they won't work if added in a client file.

GetSlots(playerId)

Use it to retrieve the current character slots from a player.

parameters:

  • playerId number: The player server ID

returns:

  • slots number

local slots = exports['av_multicharacter']:GetSlots(playerId)
print(slots)

AddSlot(playerId, amount, temp)

Adds an extra slot to the designed player ID.

parameters:

  • playerId number: The player server ID.

  • slots number: The amount of slots to add.

  • temp? boolean: If true, this extra slot will be temporal and will be available until next server restart.

returns:

  • added boolean

local added = exports['av_multicharacter']:AddSlot(playerId, amount, temp) 

RemoveSlot(playerId, amount)

Removes X character slot(s) from the desired player.

parameters:

  • playerId number: The player server ID.

  • slots number: The amount of slots to remove

returns:

  • slots number: Current player slots

local currentSlots = exports['av_multicharacter']:GetSlots(playerId)
print(currentSlots) -- extra slots = 5
local newSlots = exports['av_multicharacter']:RemoveSlot(playerId, 1)
print(newSlots) -- extra slots = 4

Please be aware that the slot counts is a sum between the default slots any player can have (3 by default) + the amount of slots a specific player owns. This exports will add/remove/return the current player extra available slots and not the total.

Last updated