Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

ZOMBIE GAME ROUND SCRIPT???

Asked by 10 years ago

This is a script that is supposed to pick 3 random zombies out of the players and create 2 team called zombies and humans and pick a random map from 1 map in ServerStorage then put it in workspace and teleport everyone to that map.

EXCEPT the script only creates the human team then errors and doesnt execute the rest Am i doing something wrong?? Is there a simpler/easier way to do this?? Please help anything is great thanks!!!

Here is the script

local h  = Instance.new("Hint")
local findMaps = game.ServerStorage["Maps"]:GetChildren()
local map = findMaps[math.random(1,2)]

h.Text = map.Name.."has been chosen!"
m = map.Clone()
m.Parent = game.Workspace
local Plrs = game.Players:GetPlayers()
local killer = Plrs[math.random(1,#Players)]

for i,v in pairs(game.Players:GetChildren()) do
    if v:findFirstChild("Character") then
        v.Character.Torso:MoveTo(188.155, 29.2, -203.112)
    end


end

0
Please do not use caps in your title. There is no need for it. Thanks! AmericanStripes 610 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
local h  = Instance.new("Hint")
local findMaps = game.ServerStorage.Maps:GetChildren()
local map = findMaps[math.random(1,2)]

h.Text = map.Name.."has been chosen!"
m = map:Clone()
m.Parent = game.Workspace
local Plrs = game.Players:GetPlayers()
local killer = Plrs[math.random(1,#Players)]
for i,v in pairs(game.Players:GetChildren()) do
    if v.Character ~= nil then
        v.Character.Torso:MoveTo(Vector3.new(188.155, 29.2, -203.112))
    end
end
Ad

Answer this question