hmm game works as intened but this is bugging me
for child in item_container.get_children():
if child.name == item_id:
return true
return false
@rpc("any_peer", "call_local", "reliable")
func recive_gift(item_id):
item_id = str(item_id)
if !item_container_has_item(item_id):
print("Item not found for receiving gift: " + item_id)
return
var item_node = item_container.get_node(item_id)
var slot_data = item_node.slot_data
if player:
player.inventory_data.inventory.pick_up_slot_data(slot_data)
@rpc("any_peer", "call_local", "reliable")
func remove_item_rpc(item_id):
item_id = str(item_id)
if item_container_has_item(item_id):
item_container.get_node(item_id).queue_free()
print("Item removed with ID: " + item_id)
else:
print("Attempted to remove item, but it was not found: " + item_id)