#Trying to Get Guards to spawn on each side of the Boss every 30s

4 messages · Page 1 of 1 (latest)

marsh fjord
#

set the humanoidrootpart position

thorn mural
#

i added it but its still not working

grizzled larkBOT
#

studio** You are now Level 1! **studio

thorn mural
#

local boss = script.Parent
local npcPrefab = game.ReplicatedStorage.Sercturity

function spawnNPC(positionOffset)
local spawnPosition = boss.Position + positionOffset
local newNPC = npcPrefab:Clone()
newNPC.Position = spawnPosition
newNPC.Parent = game.Workspace.Characters

local humanoidRootPart = newNPC:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
    humanoidRootPart.CFrame = CFrame.new(spawnPosition) 
end

end

while true do
local leftOffset = boss.CFrame.rightVector * -5
local rightOffset = boss.CFrame.rightVector * 5

spawnNPC(leftOffset)
spawnNPC(rightOffset)

wait(15)

end