I am having trouble figuring out how to make a random generating spawn to spawn the drooling zombies at and here is my current code

wait(60) -- Wait 1 minute

local enemy = game.ServerStorage["Drooling Zombie"]
local spawn = game.Workspace.Spawn

while true do
    local c = enemy:Clone() -- Clone the enemy model.
    c.Parent = game.Workspace -- Parent it to the Workspace.
    c:MoveTo(spawn.Position) -- Move the enemy to the center of Spawn's position.
end

Can someone help me?

7 comments

0

plz help

0

use math.random()

0

?

0

what is math random?

0

Randomizes the chance of a number or item being chosen.

0

If you have a list of spawns, you can do local chosenSpawn = spawns[math.random(1,#spawns)]. This will choose 1 spawn from the table that was created.

0

Table