OOP is included.
I have a simple class called Hunter which has a function Hunter:Hit that simply prints out (PLAYERNAME used hit)
In my game at some point loop through some players (hunters) and for each of the create the class Hunter and put them in another module (a table) containing all the hunter classes.
Now in game, a hunter Player1 uses Hit and it works just fine…
BUT if another player joins in team and: Player2 uses Hit, it actually will work as if Player1 has used it!
So:
Player2 uses Hunter:Hit = Output: “Player1 has used hit”
What could be the issue here, im stuck with this so hard that i can not think of any other way of doing it?
Is it because i store the classes in another table?
Storing works like this
local _Hunters = {} --in my code it actually requires a module
local HunterModule = require(game.ServerScriptService.HUNTERS.Hunter)
for _, hunter in pairs(hunters) do --hunters is a table of specific players, i checked that it is fine
local newHunter = HunterModule.new(hunter)
_Hunters[hunter.Name] = newHunter
end