# @toggle and global variable

**URL:** <https://resource.dopus.com/t/toggle-and-global-variable/51636>\
**Category:** Help & Support\
**Created:** [July 3, 2024, 5:44pm UTC](https://resource.dopus.com/t/toggle-and-global-variable/51636 "2024-07-03T17:44:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [July 3, 2024, 5:44pm UTC](https://resource.dopus.com/t/toggle-and-global-variable/51636/1 "2024-07-03T17:44:24Z")

</div>

Have set a global variable (boolean) in a JScript script, is it possible to use that variable with `@toggle` in a button.

This is not working  
`@toggle:if $glob:global_variable`

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 3, 2024, 6:44pm UTC](https://resource.dopus.com/t/toggle-and-global-variable/51636/2 "2024-07-03T18:44:44Z")

</div>

That should work, but you also need to do something extra in the thing(s) that modify the variable.

It's explained in the docs on @toggle. [Command modifier reference [Directory Opus Manual]](https://docs.dopus.com/doku.php?id=reference:command_reference:command_modifier_reference)
