I was trying to make a script where there would be a text label saying "Waiting For Enough Players" but it didn't and here's what it said:
Expected 'end' (to close 'do' at line 9), got
So here's my script:
-- Define variables
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local MapsFolder = ServerStorage:WaitForChild("Maps")
local Status = ReplicatedStorage:WaitForChild("Status")
local GameLength = 50
while true do
Status.Value = "Waiting for enough players, please dont leave"
repeat wait() until game.Players.NumPlayers >= 2
Status.Value = "Intermission"
wait(10)
plrs = {}
for i, player in pairs(game.Players:GetPlayers()) do
if player then
table.insert(plrs,player)
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("SpawnPoints not found!")
local AvailableSpawnPoints = SpawnPoints:GetsChildren()
for i, player in pairs(plrs) do
if player then
character = player.Character
if character then
-- Teleport them
character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame
table.remove(AvailableSpawnPoints,1)
-- Give them a sword
local Sword = ServerStorage.Sword:Clone()
Sword.Parent = player.Backpack
local GameTag = Instance.new("BoolValue")
GameTag.Name = "GameTag"
GameTag.Parent = player.Character
else
-- There is no character
if not player then
table.remove(plrs,i)
end
end
end
end
end
Please make so I can copy and paste because sometimes I get confused on where to put. Any help would be greatly appreciated!

1 comment
You need to put one end. And also, isn't it a script from Alvin blox? :P