RGSS3 Script help

I like to consider myself an "experienced" scripter but I cannot figure out why this snippet isn't working:

Code:
def activate()  $game_switches[998] = trueendactivate()
I've moved this thread to Script support. Please be sure to post your threads in the correct forum next time. Thank you.

RGSS3 Scripts is for finished scripts, not for questions about them.

Where did you place the definition, and where the call? Usually they can't follow each other that way
Could you close this? I figured it out too late and opened another thread. 🙁

Original thread: https://forums.rpgmakerweb.com/threads/rgss3-script-help.40651/