Skip to content

SetPlayerOutfits

Hands the player’s three outfits back - after the bag’s restore, at a login.

The table GetPlayerOutfits returns, saved with the character. Call it after SetPlayerInventory: the player’s game waits until the bag’s restore has settled, then dresses the current outfit again out of what the player carries - a class they no longer carry is left out of it - and each of the other two the first time the player switches to it; until then its reports carry those two as you set them, so a player who logs out without opening them keeps them. The result is reported (OnPlayerOutfitChange follows when it differs from the set). Called before the player is in the world, it goes out right after their spawn. What the player’s game reported before it carried the set out is not taken, so the fresh game’s empty outfits never overwrite it. A class is any key of the item catalogue.

SetPlayerOutfits(pid, outfits)
Parameter Type
pid number the player
outfits table {current = 1..3, [1] = {class, ...}, [2] = {...}, [3] = {...}}, at most 64 items an outfit

boolean - false when not connected or the table is not three outfits with current 1..3

-- at the login, after the bags: the outfits as GetPlayerOutfits gave them when they were saved
SetPlayerInventory(pid, saved.items)
SetPlayerOutfits(pid, saved.outfits)

GetPlayerOutfits · OnPlayerOutfitChange · SetPlayerInventory · the Items and inventory group of the index