'ServerScriptService.MainScript:88: Expected 'end' (to close 'do' at line 15), got <eof>; did you forget to close 'then' at line 82?

Help me with this please.

-- variebles define

local ReplicatedStorage = game: GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

local MapsFolder = ServerStorage:WaitForChild("Maps")

local Status = ReplicatedStorage:WaitForChild("Status")

local GameLength = 50

-- loop of the game

while true do
    

    
    Status.Value = "Waiting for players (This may take a bit)"
    
    repeat wait(1)  until game.Players.NumPlayers >= 2
    
        Status.Value = "Intermission"
    
        wait(15)
    
        local plrs = {}
    
        for i, player in pairs(game.Players:GetPlayers()) do
            if player then
                table.insert(plrs, player) -- add de playr to de plrs table
            end
        end
    
        wait(2) 
    
        local AvailableMaps = MapsFolder:GetChildren()
            
        ["Grass,Snow"]
    
        local AvailableMaps = MapsFolder:GetChildren()
    
        local ChosenMap = AvailableMaps[math.random(1,2)]
    
        Status.Value = ChosenMap.Name.." Chosen"
    
        local ClonedMap = ChosenMap:Clone()
        ClonedMap.Parent = workspace
    
        --teleport de playr
    
        local grasstelepors = ClonedMap:FindFirstChild("grasstelepors")
    
        if not grasstelepors then
            print("no spawn m8")
        end
    
        local Availablegrasstelepors = grasstelepors:GetChildren()
    
        ["telepor"]"telepor","telepor","telepor"
    
        for i, player in pairs(plrs) do
            if player then
                character = player.Character
            
                if character then
                    --telepor em
                    character:FindFirstChild("HumanoidRootPart").CFrame = Availablegrasstelepors[1]
                    table.remove(Availablegrasstelepors,1)
                
                    --give them swords so they can violence
                
                    local Sword = ServerStorage.Sword:Clone()
                    Sword.Parent = player.Backpack
                
                    local GameTag = Instance.new("BoolValue")
                    GameTag.Name = "GameTag"
                    GameTag.Parent = player.Character
                
                else
                    --no charecter m8
                    if not player then
                        table.remove(plrs,i)
                    end
                end
        end
    
    end


Solution 1:[1]

The error is telling you everything.

The code expected there to be an end to close your while true do on line 15, but instead of finding it, it hit the end of the file.

It is even suggesting where you made the mistake, "did you forget to close your if player then statement on line 82?"

Add an end at the end of the code block to fix it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kylaaa