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 4 years ago
Edited 4 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.

local spawner = script.Parent -- The individual part to spawn on
local human = game.ServerStorage.Enemies.Zombie -- The Zombie
game.Workspace.Part1.Touched:Wait() -- When a person touched a teleporter
    for count = 1,5,5 do
        local Clone = human:Clone()
        Clone.UpperTorso.CFrame = spawner.CFrame
        Clone.Parent = workspace
    end

game.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