Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix: Expected 'then' when parsing if statement, got 'print'?

Asked by 3 years ago

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")
                    --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

The part where it says print(player.Name.." is still in the game!") is making an error. Why is that?

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

The error is self-explanatory. You forgot a "then" for your if statement. Also, I believe you need 2 more ends after your last end.

if character:FindFirstChild("GameTag") then
Ad

Answer this question