I need help for this code

it gives that error

Screenshot from 2026-10-29 14-10-46

in item list

1. First Item

  • Text: kılıç yüks (appears to be an abbreviation for sword upgrade/leveling)

  • Icon: A file/folder icon assigned

  • Selectable: On (checked)

  • Disabled: Off (unchecked )

2. Second Item

  • Text: ekstra kal (appears to be an abbreviation for extra cal, extra caliber, or simila r)

  • Icon: A file/folder icon assig ned

  • Selectable: On (chec ked)

  • Disabled: Off (unche cked)

and here is code

extends TileMapLayer


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	if Global.gunduz1deyiz == true:
		$TileMapLayer.self_modulate =Color(1,1,1,1)
	
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	if $Area2D/CharacterBody2D/ItemList.select("item_0/text"):
		Global.oyuncu_hasar += 50

why this happening?

and how can i fix it

Please post the select function from node ItemList. The method most likely returns void, so you can’t use it in an if statement.

TokyoFunkScene is right about ItemList.select – it returns void and what you might want instead is ItemList.is_selected(idx: int)but that requires an id that you don’t have.

That bit of code give a bad vibe though, especially the node being a TileMapLayer
Have you considered to implement whatever this feature (player taking damage when they hold a sword their sword up?) with using signals and timers (that are created by the timer and loop depending on a flag set by the signal) instead? The logic being inside _processwithout you using delta in any ways will give you funny results sooner or later.