i have a game with a combat system, and all the player stats are stored in a module.
here’s what a server of 4 people would look like in the module
module = {
["player1"] = {
inventory = {},
states = {},
cooldowns = {},
fightingstyle = "none",
index = {}
},
["player2"] = {
inventory = {},
states = {},
cooldowns = {},
fightingstyle = "none",
index = {}
},
["player3"] = {
inventory = {},
states = {},
cooldowns = {},
fightingstyle = "none",
index = {}
},
["player4"] = {
inventory = {},
states = {},
cooldowns = {},
fightingstyle = "none",
index = {}
}
}
of course all their stats are random and the tables are full.
one thing that i’m not sure is ok is that i have functions in that same table with the other player’s stats.
idk if that causes the issue i’m having which is player’s stats randomly being mixed up, and having other people’s stats for what it seemed to be. so i’m curious if i’m using a modulescript wrong, or i would have to look into it more