Don't work, I want to get data from Firebase Very urgently needed!

extends Control
var db_ref

func _ready():
db_ref = Firebase.Database.get_database_reference(“leaderboard”, {FirebaseDatabaseReference.LIMIT_TO_LAST : 10})

db_ref.new_data_update.connect(_on_leaderboard_updated)

func _on_leaderboard_updated(data):
if data.error:
print(“Error fetching leaderboard data:”, data.error)
return

var leaderboard = data.data
var rank = 1

print("Leaderboard:")
for entry_key in leaderboard.keys():
	var entry = leaderboard[entry_key]
	var username = entry.get("username", "Unknown")
	var score = entry.get("score", 0)
	print(rank, ": ", username, " - ", score)
	rank += 1
	if rank > 10:
		break

i get
image

It looks like you’re using a firebase add-on of some sort, not sure why it is giving a “_root” key that you can’t access but you could try skipping it in the loop if it’s not necessary

for entry_key in leaderboard.keys():
    if entry_key == "_root":
        continue
    ...
    ...