Untitled

 avatar
unknown
plain_text
a year ago
720 B
6
Indexable
local miejsca = game.Workspace.Miejsca:GetChildren()

while true do

	if game.ReplicatedStorage.AktywnaGra.Value == true then

		if game.ReplicatedStorage.ZombieDoWygenerowania.Value > 0 then

			local nowyZombie = game.ReplicatedStorage.Zombie:Clone()

			local root = nowyZombie:FindFirstChild("HumanoidRootPart")

			local losoweMiejsce = math.random(1,#miejsca)

			local losowyX = math.random(-10,10)
			local losowyZ = math.random(-10,10)

			root.Position = Vector3.new(
				miejsca[losoweMiejsce].Position.X + losowyX,
				6,
				miejsca[losoweMiejsce].Position.Z + losowyZ
			)

			nowyZombie.Parent = workspace.Zombiaki

			game.ReplicatedStorage.ZombieDoWygenerowania.Value -= 1


		end

	end


	wait(0.2)
end
Leave a Comment