Hello! I've been working on a npc spawn block, and it's been working, but periodically, it spawns NPCs at the opposing team's spawn! Why does it do this? Here's the code:
local spawnPos = script.Parent while wait(45) do local noob1 = game.ServerStorage.Noobs["Bomber"]:clone() noob1.Parent = game.Workspace noob1:MoveTo(pos.Position + Vector3.new(0,1,0)) noob1:MakeJoints() end
What's wrong with it?
Line 6: noob1:MoveTo(pos.Position + Vector3.new(0,1,0))
You haven't defined what pos
is in pos.Position
, try fixing that. I think you mean to replace it with spawnPos.