How to check the boolValue which is in the image via script

So I have a boolValue at Image, I need to make a check-in NOT LOCAL SCRIPT, if Unlocked = true, then output something in output (at your discretion), how to do this, and where should the script be located?

P.S. I need this information because in my skill tree when the player learns the skill Damage I have to add him Damage, for this I do this check so in my not local script to give not 5 Damage and 10.
Снимок экрана 2023-05-30 в 20.59.18

as I understand it I have to either use the events but how? or get playerGui in a non-local script

You can reference pretty much anything in the game if you just give it’s location in the script you use.
We can’t tell because you don’t include the Workspace, Service, or Folder location that Damage1 is located. If it was in the workspace then you could reference

if workspace.Damage1.Unlocked.Value then --this checks to see if Unlocked is true.
    --your code output

If it’s located in a model, or some other location then reference that.
If the script is inside a model you can use

if script.Parent.Parent.(whatever the path is from your script to the location of Unlocked.Value is) then
    --your code output