-- Define variables --Made by munder12e--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local MapsFolder = ServerStorage:WaitForChild("Maps")
local Status = ReplicatedStorage:WaitForChild("Status")
local GameLength = 80
-- Game loop
while true do
Statues.Value = "Waiting for enough players"
repeat wait(1) until game.Players.NumPlayers >= 2
Status.value = "intermission starting in 10"
wait (10)
local plrs = {}
for i, player in pairs (game.Pyer:GetPlayers()) do
if player then
table.insert(plrs,player) -- Add each player into plrs table
end
end
wait (2)
local AvailableMaps = MapsFolder:GetChildren()
local ChosenMap = AvailableMaps[math.random(1,#AvailableMaps)]
Status.Value = ChosenMap.Name.." Chosen"
local ClonedMap = ChosenMap:Clone()
ClonedMap.Parent = workspace
-- Teleport players to the map
local SpawnPoints = ClonedMap:FindFirstChild ("SpawnPoints")
if not SpawnPoints then
print("Spawnpoint not found")
local AvailableSpawnPoints = SpawnPoints:GetChildren ()
for i, player in pairs (plrs)do
if player then
character = player.Character
if character then
-- Teleport them
character:FinsFirstChild ("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].Cframe
table.remove(AvailableSpawnPoints,1)
-- Give them a sword
local ClassicSword = ServerStorage.ClassisSword:clone ()
ClassicSword.Parent = player.Backpack
local Handgun = ServerStorage.Handgun:clone ()
Handgun.Parent = player.Backpack
local GameTag = Instance.new("BoolValue")
Gametag.Name = "GameTag"
Gametag.Parent = player.Charatcer
else
-- There is no character
if not player then
table.remove(plrs,i)
end
end
end
end
end~~~~~~~~~~~~~~~~~

1 comment
line 11 you did game.Pyers