Making an array with a spot for every client - NodeJs
I am trying to make a few variables that every client can have their own of
Code:
private tradeID: {
[guid: string]: number
};
private spamWaited: {
[guid: string]: number
};
private theirslots: {
[guid: string]: boolean[]
};
constructor () {
this.tradeID = {};
this.spamWaited = {};
this.theirslots = {};
Client.on('connect', (pd, client: Client) => {
this.tradeID[client.alias] = 0;
this.spamWaited[client.alias] = 0;
//set the lenght of the arrays to 12 and fill with false.
this.theirslots[client.alias].length = 12;
this.theirslots[client.alias].fill(false);
});
}
but when I try to write to them I get this error:
Code:
[09:27:10 | PluginManager] Error while calling NEWTICK hook on TradebotReborn
[09:27:10 | PluginManager] TypeError: Cannot set property 'SHENDYT' of undefined