Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.