If you want a detailed explanation on how to clone mobs you can watch this GnomeCode video on tower defence stuff:
Wave Based Attacks - Tower Defense Tutorial #2 (youtube.com)
Just change the
local NPCs = {
enemiesFolder.killguy
}
to
local NPCs = {
killguy = enemiesFolder.killguy
}
In the first, you are calling a NPCs.killguy doesnât exist, as there is no entry in the array NPCs called killguy. Your mistake was in not thinking through the information that the computer has access to. The computer will not magically find the killguy part that is under enemiesFolder, you need to tell it that that is the killguy NPC.
Consider marking this as a solution if your problem was solved.
the npc arent spawning in the position of the spawner
try
clone.PrimaryPart.CFrame = spawner:GetPivot()
If that doesnât work, then see what print(spawner:GetPivot())
outputs.
they spawning in the floor and changing the Y value does nothing
Try
clone.PrimaryPart.CFrame = spawner:GetPivot()+Vector3.new(0,3,0)
just put it slightly above the ground
and instead of clone.PrimaryPart...
just do clone:SetPrimaryPartCFrame(spawner.CFrame)
SetPrimaryPartCFrame is depreacted
oh
i mean i still use it, so it canât be that bad
i have done all those solutions
wont work
ughhh
any errors? can i see your code and explorer?
yeah sure there was one error in the spawning script too btw the killguys are stored in replicated storage before spawning
you donât have a humanoid root part inside the enemy : (
do you even have a humanoid in there to begin with
what do you mean? i have them
Animate should be a server script, not a local script (because itâs an NPC)
you clearly donât if the code doesnât see the root part