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

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

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

2 comments

0

On which line does this error occur?

0

you made an error at "if not then print("Spawnpoints not found!") end" if not what exactly?

1 answer

✓ Accepted answer

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

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