Waiting 15 seconds before spawning NPC

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
Screenshot 2024-07-24 213349

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

1 Like

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


output

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
Screenshot 2024-07-25 113617

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