Is it possible to toggle a script from another script?

Greetings,

I have finally managed to create a proper custom shift lock that toggles on a button. The reason I wanted one in the first place was so that I can turn it off when radial menu gui i am making is turned on so that that he camera doesn’t follow your mouse while you select from the menu.

My question is, if i have a local script in starter players that toggles on and off with “V” how would i fire it from another script.

So the functionality i want is this:

    • shift lock turned on by pressing “V”
    • player holds “C” to open menu
    • this activates the first script turning shift lock off
    • player releases “C”
    • this fires the first script again turning the custom shift lock back on

Any advice would be greatly appreciated

Thank you for your time

Can’t you just connect/disconnect the event or alternatively place in a boolean debounce to prevent it from firing?

3 Likes

thank you for the idea. It seems so obvious in hindsight :smiley:

Answer for those with the same issue:

I solved it by changing how things work:
instead of activating shift lock with V, V now changes the state of a boolValue in the Players.PlayerName, so that other scripts can just change the value of the boolValue to turn it on and off

1 Like