Hello everyone!
I'm a newbie modder and i need help with quickscope script

I've got this
Code:
Quickscope()
{
        self endon ( "disconnect" );
        self endon ( "death" );
self notifyOnPlayerCommand("[{+toggleads_throw}]", "+toggleads_throw");
        while(self getCurrentWeapon() == "cheytac_fmj_heartbeat_mp")  //This is the part that doesn't seem to work
{
		
                self waittill("[{+toggleads_throw}]");
                wait 1.0;
                self allowADS(false);
                wait 0.0005;
                self allowADS(true);
            
                wait 0.0005; }
But this doesn't seem to work...
If i use "while(1)" instead of "while(getCurrentWeapon()...." part it works, but it does that for all weapons, and i only want to do it when Intervention is in use...

Also, i got "self thread QuickScope();" in onPlayerSpawned(), before the for ( ; ; ) loop

Thanks to everyone who decides to help me