I'm trying to make a script to where when a certain number is randomly generated it spawns a zombie. I hope someone could help me out!
game.Players.PlayerAdded:Connect(function()
local ServStoarge = game:GetService('ServerStorage')
local Zombie = ServStoarge.Zombie
local Spawner = game.Workspace.Spawner
while true do
print(math.random(1, 5))
if math.random == 1 then
Zombie:Clone()
Zombie.HumanoidRootPart.CFrame = game.Workspace.Spawner.CFrame + Vector3.new(0, 2, 0)
end
end
end)

1 comment
Oh hey that works! thanks man :D I'm newer to scripting I used to do modeling so this is a big help even if it is just some reorganization. Have a great day or night and thanks for the help :)