Help with progress bar

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Comet

(Sorry for my english i’m using google translator)
I made a strip of hp, and a command to restore it, but I noticed that when I restore hp, the value is greater than 100

Hard to answer without seeing the code. Can you show / describe what’s in your restore function?

Thomas Karcher | 2019-07-01 15:25

Maybe you accidentally enable Allow Greater?

Dlean Jeans | 2019-07-01 15:37

Allow greater switched off

Comet | 2019-07-01 15:49

onready var hp = 100

func _ready():
    console.connect('text_entered', self, 'console')

func _input(event):
    if event.is_action_pressed('ui_focus_next'):
	hp -= 10

func _physics_process(delta):
   if hp >= 1:
	hp += delta * 0.6

func console(text):
        elif text == 'hp' || text == 'health': #When I enter it, I get more hp than needed		
        $Console/TextConsole.add_text('\ncheat true')		
    hp += 100

Comet | 2019-07-01 15:54

:bust_in_silhouette: Reply From: Dlean Jeans

Just change

hp += 100


hp = 100