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

Why are my npcs not spawning on each individual part?

Asked by 5 years ago
Edited 5 years ago

Hello, i created a script that i duplicated to each part, it is a spawner script for npc's. The issue is, they dont spawn on the parts, but on a random point all together. Added comments to explain some things.

01local spawner = script.Parent -- The individual part to spawn on
02local human = game.ServerStorage.Enemies.Zombie -- The Zombie
03game.Workspace.Part1.Touched:Wait() -- When a person touched a teleporter
04    for count = 1,5,5 do
05        local Clone = human:Clone()
06        Clone.UpperTorso.CFrame = spawner.CFrame
07        Clone.Parent = workspace
08    end
09 
10game.Workspace.Iteration.Value = game.Workspace.Iteration.Value + 0.1 -- This is for when each part spawns all there zombies, it will add up to one

Answer this question