One TAG to change another TAG (don't work)

Hi

I want my "Tag1" to change "Tag2" , should be simple, but it does not work.
I`m new to code, so I cant see what is wrong.

def Tag1_changed(tag, previousValue, currentValue, quality, timestamp):
    if currentValue.value == 1:
        system.tag.writeBlocking(["Tag2"], [1])
        
system.tag.addTagChangeListener("Tag1", Tag1_changed)

The goal: Tag1 is MQTT tag that I control from MQTT.
Then I want Tag2 , that is Memory tag in the PLS to trigger from the State of the MQTT tag.

You can't just make things up. This function doesn't exist.

You're almost there though - add the logic to write to the other tag to a tag change event script.

This is supposed to write to the tag.

Tag1_value = system.tag.readBlocking("Tag1")[0].value
system.tag.writeAsync("Tag2", Tag1_value)

This worked.

Not sure if I should stop testing.
I manage to copy the Tag function to work.

But it only works when I do it from my memory Tag.
When I replace the path and name from "Default Tag1" to my "MQTT TagName" it does not copy the tag.

Is it not possible to copy all tags? do they need to be in same tag group maybe.