How to add 2 variables to a table

So i am working on a system where i put every single enemy in a table. But the enemies have the same name. How can i get both enemies?

Note: there will be other names in the table as well.

local Enemytable = {
   ememy = Vector3.new() -- basicly the position of the enemy, its irrelevant
   ememy = Vector3.new()
   ememy = Vector3.new()
   Enemy2 = Vector3.new
}

As you can see, i have 3 “enemy” + Enemy2. How can i seperate them from eachother?
So: How can i print both Positions?

You can index the instance itself not a name like:

local EnemyTable = {}
EnemyTable[Instance] =  Vector3.new(...)
4 Likes

So when printing it, this is correct right?
image

Yeah, it should be a unique index.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.