Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local places = game.Workspace.Locations:GetChildren()
- while true do
- if game.ReplicatedStorage.ActiveGame.Value == true then
- if game.ReplicatedStorage.ZombiesToGenerate.Value > 0 then
- local newZombie = game.ReplicatedStorage.Zombie:Clone()
- local root = newZombie:FindFirstChild("HumanoidRootPart")
- local randomPlace = math.random(1, #places)
- local randomX = math.random(-10,10)
- local randomZ = math.random(-10,10)
- root.Position = Vector3.new(
- places[randomPlace].Position.X + randomX,
- 6 ,
- places[randomPlace].Position.Z + randomZ)
- newZombie.Parent = workspace.Zombies
- game.ReplicatedStorage.ZombiesToGenerate.Value -= 1
- end
- end
- wait(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement