I think there are two question to know.
Were those buttons have same parent?
If The answer is yes, then variable id = get_name() is unique, since you can't have same names in one parent.
Where were you print those ids?
If you print it in function _process(delta), then you have to label then, otherwise you can't know the print is from which button.
(Since all buttons will print no matter you pressed or not If you print it in function _process(delta).)
for example you can print and test like this:
Just print it in "if Pid==id" condition, i.e.:
func _on_Button_toggled(button_pressed:bool, Pid:String):
if Pid == id: #check the button is you actually pressed one
if button_pressed == true:
$Poision.play("Active")
e = 0
elif button_pressed == false:
$Poision.play("default")
e = 1
print("name: ", get_name(), ", id: ", id,", e: ", e) # label print
then you will got print result like this folling:
name: Button, id: Button, e: 0 # first time when I pressed Button
name: Button2, id: Button2, e: 0 # first time when I pressed Button2
name: Button, id: Button, e: 1 # second time when I pressed Button
name: Button3, id: Button3, e: 0 # first time when I pressed Button3
name: Button, id: Button, e: 0 # third time when I pressed Button again
name: Button2, id: Button2, e: 1 # second time when I pressed Button2
you will find that each variable e in each button is seperate.