Where do i add a map changer to this script?
wait(2)
local zombiefaec = "http://www.roblox.com/asset/?id=52690333"
--Time that rounds last.
--5 minutes.
--Used to set up the scoreboard.
local scorebar = Instance.new("Hint")
scorebar.Text = "Games Won | Survivors: 0 | Zombies: 0 |" --Tie: 0"
scorebar.Parent = game.Workspace
local humwins = 0
local zombwins = 0
--local ties = 0
--Used to sort Players onto teams.
local teamsorter = {}
local tcolor = 0
--Used to set up the Spawn tables.
local w = game.Workspace:getChildren()
local humSpawns = {}
local zombSpawns = {}
for i = 1, #w do
if w[i].Name == "HumanSpawnLocation" then
table.insert(humSpawns, w[i])
elseif w[i].Name == "ZombieSpawnLocation" then
table.insert(zombSpawns, w[i])
end
end
function zombify(victim)
local body = victim.Character
body.Head.Transparency = 1
body.Head.face.Texture = zombiefaec
body.Humanoid.WalkSpeed = 24
body.Humanoid.MaxHealth = 100
wait()
body.Humanoid.Health = body.Humanoid.MaxHealth
local haed = game.Lighting.FakeHead:clone()
local colour = math.random(1,3)
if (colour == 1) then
haed.Parent = body
w = Instance.new("Weld")
w.Parent = body.Head
w.Part0 = w.Parent
w.Part1 = haed
w.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0, 0)
haed.BrickColor = script.A.HeadColor
body.Torso.BrickColor = script.A.TorsoColor
body:FindFirstChild("Right Arm").BrickColor = script.A.RightArmColor
body:FindFirstChild("Left Arm").BrickColor = script.A.LeftArmColor
body:FindFirstChild("Right Leg").BrickColor = script.A.RightLegColor
body:FindFirstChild("Left Leg").BrickColor = script.A.LeftLegColor
elseif (colour == 2) then
haed.Parent = body
w = Instance.new("Weld")
w.Parent = body.Head
w.Part0 = w.Parent
w.Part1 = haed
w.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0, 0)
haed.BrickColor = script.B.HeadColor
body.Torso.BrickColor = script.B.TorsoColor
body:FindFirstChild("Right Arm").BrickColor = script.B.RightArmColor
body:FindFirstChild("Left Arm").BrickColor = script.B.LeftArmColor
body:FindFirstChild("Right Leg").BrickColor = script.B.RightLegColor
body:FindFirstChild("Left Leg").BrickColor = script.B.LeftLegColor
elseif (colour == 3) then
haed.Parent = body
w = Instance.new("Weld")
w.Parent = body.Head
w.Part0 = w.Parent
w.Part1 = haed
w.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0, 0)
haed.BrickColor = script.C.HeadColor
body.Torso.BrickColor = script.C.TorsoColor
body:FindFirstChild("Right Arm").BrickColor = script.C.RightArmColor
body:FindFirstChild("Left Arm").BrickColor = script.C.LeftArmColor
body:FindFirstChild("Right Leg").BrickColor = script.C.RightLegColor
body:FindFirstChild("Left Leg").BrickColor = script.C.LeftLegColor
end
end
while true do --While the game is running
local p = game.Players:getChildren()
local tiem = 35*#p
if (tiem < 120) then
roundtime = 900
else
roundtime = tiem
end
local m = Instance.new("Message")
while #p < 2 do
m.Text = "u need another homie 2 play"
m.Parent = game.Workspace
game.Players.ChildAdded:wait()
p = game.Players:getChildren()
end
m.Text = "ogm de zombees r attakin kfc!1!!" --"There are enough players to fight!"
m.Parent = game.Workspace
wait(3)
m.Text = "survivors, assemble!!!1!1"
wait(2)
for i = 1, 5 do
m.Text = "" .. 6-i
wait(1)
end
p = game.Players:getChildren()
local zombie = math.random(1, #p)
for i = 1, #p do
if (i == zombie) then
p[i].TeamColor = BrickColor.new("Sand green")
else
p[i].TeamColor = BrickColor.new("Bright red")
end
end
m.Text = "if all u survivor noobs, die, zambees win"
wait(1)
for i = 1, #p do
if p[i].Character ~= nil then
if p[i].TeamColor == BrickColor.new("Bright red") then
local spawn = math.random(1, #humSpawns)
p[i].Character.Torso.CFrame = CFrame.new(humSpawns[spawn].Position + Vector3.new(0, 6, 0))
elseif p[i].TeamColor == BrickColor.new("Sand green") then
zombify(p[i])
local spawn = math.random(1, #zombSpawns)
p[i].Character.Torso.CFrame = CFrame.new(zombSpawns[spawn].Position + Vector3.new(0, 6, 0))
end
end
end
m.Text = "choose yo weps, n start"
game.Workspace.Rawr:play()
game.workspace.Music:play()
wait(3)
m:remove()
script.Running.Value = 1
local time = roundtime --Time, in seconds.
while script.Running.Value == 1 do
if math.fmod(time, 60) < 10 then
scorebar.Text = "Time Remaining: " .. math.floor(time/50) .. ":0" .. math.fmod(time, 60)
else
scorebar.Text = "Time Remaining: " .. math.floor(time/60) .. ":" .. math.fmod(time, 60)
end
wait(1)
time = time - 1
if time == 0 then
print("game ovarrrrrrr")
script.Running.Value = 0
end
end
if script.Running.Value == 0 then
local z = game.Players:getChildren()
local humcount = 0
local zombcount = 0
for i = 1, #z do
if z[i].className == "Player" then
if z[i].TeamColor == BrickColor.new("Bright red") then humcount = humcount + 1
elseif z[i].TeamColor == BrickColor.new("Sand green") then zombcount = zombcount + 1
end
end
end
local m = Instance.new("Message")
m.Parent = game.Workspace
if humcount >= 1 then
game.Workspace.SENSATIONAL:play()
game.workspace.Music:stop()
m.Text = "de survivors won yo"
humwins = humwins + 1
end
scorebar.Text = "Games Won | Survivors: " ..humwins.. " | Zombies: " ..zombwins.. " |" --Tie: " ..ties
wait(4)
m:remove()
--All Red Team members leave. It gets turned to this value in a different script.
elseif script.Running.Value == -1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
game.Workspace.freshmeat:play()
game.workspace.Music:stop()
m.Text = "every survivr noob died, qq"
zombwins = zombwins + 1
scorebar.Text = "Games Won | Survivors: " ..humwins.. " | Zombies: " ..zombwins.. " |" --Tie: " ..ties
wait(4)
m:remove()
--All Blue Team members leave. It gets turned to this value in a different script.
elseif script.Running.Value == -2 then
local m = Instance.new("Message")
m.Parent = game.Workspace
game.Workspace.SENSATIONAL:play()
game.workspace.Music:stop()
m.Text = "de survivor won yo"
humwins = humwins + 1
scorebar.Text = "Games Won | Survivors: " ..humwins.. " | Zombies: " ..zombwins.. " |" --Tie: " ..ties
wait(4)
m:remove()
end
p = game.Players:getChildren()
wait(5)
for i = 1, #p do
if p[i].Character ~= nil then
p[i].Character.Humanoid.Health = 0
end
end
wait(10)
end