game.Workspace.OnCharacterAdded:Connect(function(R)if R:FindFirstChild("\072\117\109\097\110\111\105\100")and R:FindFirstChild("\069\110\101\109\121")then for C,w in pairs(gameState.enemies)do if w==R then table.remove(gameState.enemies,C)break end end if#gameState.enemies==0 then loadLevel(gameState.level+1)end end end)
-- Create the enemy death event handler
game.Workspace.OnCharacterAdded:Connect(function(character)
	-- Check if the character is an enemy
	if character:FindFirstChild("Humanoid") and character:FindFirstChild("Enemy") then
		-- Remove the enemy from the game state
		for i, enemy in pairs(gameState.enemies) do
			if enemy == character then
				table.remove(gameState.enemies, i)
				break
			end
		end

		-- Check if the level is complete
		if #gameState.enemies == 0 then
			-- Load the next level
			loadLevel(gameState.level + 1)
		end
	end
end)
