I was trying to make a zombie summoner for my zombie fighting game but it doesn’t work, it only summoned one zombie. I didn’t find any solution to it whatsoever. If there is a way to fix please reply down bellow.
Code:
local Minions = game.ReplicatedStorage.Minions:Clone()
local Pos = script.Parent.Position + Vector3.new(0,3,0)
while true do
wait(10)
Minions.Parent = game.Workspace
Minions.Position = Pos
end
You are not cloning the minions inside of the loop.
You should do this:
local Pos = script.Parent.Position + Vector3.new(0,3,0)
while true do
wait(10)
local Minions = game.ReplicatedStorage.Minions:Clone()
Minions.Parent = game.Workspace
Minions.Position = Pos
end
What you’re doing is making 1 Minion, parenting the minion to workspace and then doing it every 10 seconds and saving the “Pos” as a permanent Vector3, not above the Summoner.
I suggest changing it to:
local Summoner = script.Parent.Parent -- fix this path
while Summoner and Summoner:FindFirstchild("Humanoid") and wait(10) do
local Minion = game.ReplicatedStorage.Minions:Clone()
Minion.Parent = game.Workspace
Minion.CFrame = Script.Parent.CFrame + Vector3.new(0,3,0)
end
If minions is a model and not a part, it does not have a position property and the line where you set its position will error. You can try this instead:
Can you show us the layout of the Summoner and the Minion? Like their children and path in explorer.
Try using:
local Minion game.ReplicatedStorage.Minions
local Summoner = script.Parent.Parent -- fix this path
repeat
local NewMinion = Minion:Clone()
NewMinion.Parent = workspace
NewMinion.HumanoidRootPart.CFrame = Summoner.HumanoidRootPart.CFrame + Vector3.new(0,3,0)
wait(10)
until not Summer or not Summoner:FindFirstchild("Humanoid") or Summoner.Humanoid.Health == 0