Ad
Log in to vote
0

Expected identifier when parsing got 'then' I've also tried removing ends and adding ends?

Asked by 1 year ago

if not then print("Spawnpoints not found!") end

local AvailableSpawnPoints = SpawnPoints:GetChildren()

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


Status.Value = ("Get ready to play!")   

wait(2)

for i = GameLength,0,-1 do

    for x, player in pairs(plrs) do
        if player then

            character = player.Character

            if not character then
                -- Left the game
            else
                if character:FindFirstChild("GameTag") then
                    -- They are still alive
                    print(player.Name.."is still in the game!")
                else
                    -- They are dead
                    table.remove(plrs,x)
                    print(player.Name.."has been removed!")
                end
            end
        else
            table.remove(plrs,x)
            print(player.Name.."has been removed!")
        end
    end

    Status.Value = "There are " ..i.. "seconds remaining, and "..#plrs.. "players left"

    if #plrs == 1 then
        -- Last person standing
        Status.Value = "The winner is ".. plrs[1].Name
        plrs[1].leaderstats.Bucks.Value = plrs[1]. leaderstats.Bucks.Value + reward
        break
    elseif #plrs == 0 then
        Status.Value = "Nobody won!"
        break
    elseif i == 0 then
        Status.Value = "Times up!"
        break

    end

    wait(1)
end

print("End of Game!")


end
    ClonedMap:Destroy()

    Status.Value = "Game ended"

    wait(2)

end

0
On which line does this error occur? Bankrovers 226 — 1y
0
you made an error at "if not then print("Spawnpoints not found!") end" if not what exactly? spunargar -6 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago

You have to specify what it is "not" suppose to be or it will error.

Ad

Answer this question