Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my NPC spawn block spawn it's NPCs at another spawn block?

Asked by 6 years ago

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?

0
is there more code to this? PoePoeCannon 519 — 6y
0
No. Code_Sensei 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question