I'd like help on techniques, and how to clone maps into the game, and how to respawn players?
This is the script: -- If there's any problems please tell me
while true do
A = game.Players
if A.NumPlayers == 1 then print("There's not enough players in the game for the game to start.")
A1 = "This service is unavailable, please wait until 1 more player joins..."
A2 = "Welcome to the official meadows sfing game"
A4 = "5"
A3 = "The amount of players is successful, and the game will be starting in" .. A4 .. "Seconds.."
A5 = "Teaming players..."
A6 = "Blue team has won"
A7 = "Red team has won"
local M = Instance.new("Message",workspace)
elseif A.NumPlayers > 1 then
print(NumPlayers.." Is the amount of players in the game.")
wait(0.1)
if A.NumPlayers == NumPlayers >2 then
print("Success")
wait(3)
elseif A.NumPlayers == NumPlayers <1 then
repeat
wait(3) M.Text = A1 wait(1) M:Destroy() wait(1)
local M = instance.new("Message",workspace)
until
A.NumPlayers == NumPlayers >1
end
wait(5)
if M == nil then
print("Need to create message")
local M = instance.new("Message",workspace)
elseif M == not nil then
print("Moving on")
M.Text = A2
wait(1)
M.Text = A3
wait(0.1)
function fixTeams()
BlueTeam = clones[1].Parent == game.Teams -- This is the blue team
RedTeam = clones[2].Parent == game.Teams -- This is the red team
end
wait(3)
M.Text = A5
function checkSpectators()
spectators = 0
for _, player in pairs(game.Players:GetChildren()) do
if player.TeamColor == game.Teams.Spectators.TeamColor then
spectators = spectators + 1
end
end
if(spectators == A.NumPlayers) then
BlueTeam:Destroy()
RedTeam:Destroy()
Wait(3)
function findwinner()
redplayers = 0
blueplayers = 0
BlueTeam = game.Teams.BlueTeam.TeamColor
RedTeam = game.Teams.BlueTeam.TeamColor
for _, player in pairs(game.Players:GetChildren()) do
if player.TeamColor == game.Teams.BlueTeam.TeamColor then
players = redplayers + 1 and blueplayers + 1
wait(5)
if blueplayers == 0 then
print("Blue team has lost")
M.Text = A7
elseif player.TeamColor == game.Teams.RedTeam.TeamColor then
if redplayers == 0 then
print("Red team has lost")
M.Text = A6
fixteams()
checkspectators()
findwinner()
end
end
end
end
end
end
end
end
end
end
