22. Delete the row the player chose
A fixed Item ID field is fine for a known row. To delete whichever row the player selected, read selected_clue in a script and pass that value as itemId. Do not assume typing $$selected_clue into an ID field will expand it.
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
var chosen: String = str(
Runtime.variables.get("selected_clue", "")
)
if chosen.is_empty():
await SetVariable({
"name": "clue_feedback",
"value": "Choose a clue first."
})
return false
await ListBoxDeleteItem({
"guiId": "clues_page",
"elementId": "clue_list",
"itemId": chosen
})
await SetVariable({
"name": "clue_feedback",
"value": "Removed from the list: " + chosen
})
return true1. Create a GDScript record with this source and Apply Changes.
2. Add a Delete chosen clue Button and set its Click event to run that script.
3. Choose letter and press the button. The row disappears and the selected ID clears because that row no longer exists.
This example is for the manual clue list. It is not an inventory removal script and does not delete an inventory definition.
