I need help with a collectable item

Godot Version

GODOT 4.3

Question

I’ve written some code for a collectable that can keep track of the score even when going into different levels, but i can’t find out how to finish it so the score is shown on a label

What is pointslabel’s type? If it’s a Label, try pointslabel.text = str(global_coin_count) instead of the code you currently have on line 19.

2 Likes

Thanks, I don’t know how I missed that one. It also doesn’t keep the score when moving into the next level, would you know how to fix that?

I do. Here’s a link to a previous answer that covers the subject. The answer is about a label that displays a countdown timer, but it should work the same way:

2 Likes

Thanks! I’ll check it out now

It says @extends is not allowed in this level. Am i doing something wrong or was that changed in a recent update?

There’s an error in the script. It should be:

extends Node

@export var countdown_value : int = 0