-
What do you want to achieve?
Anytime a script tries to grab the data for a specific enemy it returns nil, but the enemy is in the ModuleScript. -
What is the issue?
The enemy is really far down the ModuleScript, but it’s defined like every other enemy and those work fine. I generated the ModuleScript with another programming language so I know there isn’t any typos. -
What solutions have you tried so far?
Grabbing a different key from the enemy, same error.
Code to the script:
local function ChooseRandomZombie()
local Type
local Zombie
while Zombie == nil do wait()
Type = ChooseRandomChild(Zombies)
local ZombieChosen = ChooseRandomChild(Type)
if ZombieChosen then
print(ZombieChosen.Name)
local Rarity = EnemyStats[ZombieChosen.Name]["Rarity"]
if math.random(1,Rarity) == 1 then
Zombie = ZombieChosen
end
end
end
return Zombie:Clone(), Type.Name
end