Workshop.codes
Create

Set Player Variable At Index Last updated November 26, 2024

Description

Finds or creates an array on a player variable, which is a variable that belongs to a specific player, then stores a value in the array at the specified index.

Snippet

Set Player Variable At Index(Event Player, variableName, 0, 0);

Properties

Returns: Void
Parameters: Player, Variable, Index, Value

Player
Type: Player | Array (Player), Default: Event Player
The player whose variable will be modified. If multiple players are provided, each of their variables will be set.

Variable
Type: Player Variable, Default: A
Specifies which player variable's value is the array to modify. If the variable's value is not an array, then its value becomes an empty array.

Index
Type: Integer, Default: Number
The index of the array to modify. If the index is beyond the end of the array, the array is extended with new elements given a value of zero.

Value
Type: Object | Array, Default: Number
The value that will be stored into the array.

Workshop.codes