States

A system to save and load player states.

Functions

Player:DeleteState(name)

View source »

Removes a state.

Parameters

Player:GetAllStates()

View source »

Gets all the states in a table

Returns

Player:ReadState(name)

View source »

Get a state from a player, this persists after a disconnect! If it's the same player, you'll have the same states!

Parameters

  • name string

    Index of the state.

Player:RestoreAnglesFromState(name)

View source »

Restores specific data.

Parameters

  • name string

    state index to restore from

Player:RestoreArmorFromState(name)

View source »

Restores specific data.

Parameters

  • name string

    state index to restore from

Player:RestoreHealthFromState(name)

View source »

Restores specific data.

Parameters

  • name string

    state index to restore from

Player:RestoreModelFromState(name)

View source »

Restores specific data.

Parameters

  • name string

    state index to restore from

Player:RestorePositionFromState(name)

View source »

Restores specific data.

Parameters

  • name string

    state index to restore from

Player:RestoreSkinFromState(name)

View source »

Restores specific data.

Parameters

  • name string

    state index to restore from

Player:RestoreState(name)

View source »

Loads the players state by index. Internally uses Player:ReadState

Parameters

  • name optional

    The index of the state index, if nil uses latest state.

Player:SaveState(name)

View source »

Saves a state of the player, by default used for Moderation and Death Sting.

Parameters

  • name string optional

    Index of the state.