Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Toggle feature on and off
#1
I am making a mod that is based on the telekinetic roll on RTD. I have everything ready but I am wanting to make it so I can turn off and on the telekinetic shooting. I have tried this and it has not worked.
PHP Code:
for(;;)
{
while(!
self useButtonPressed()) 
wait 0.05;
doTelekinetic();
wait 0.5;
while(!
self useButtonPressed())
wait 0.05;
self notify("stopkinetic");
wait 0.5;

I put that into the the onplayerspawned();
I then added this.
PHP Code:
doTelekinetic()
{
self endon("death");
self endon("stopkinetic");

//telekinetic code here

It somewhat works as when you first spawn you can turn it on but can't turn it back off then when you respawn you lose the weapon you should have and can only turn it on.
Reply

#2
Anyone? I want to have this in the first release.
Reply

#3
Look at the way the jetpack on use is coded in, try and go with that? Not sure who made it but it uses a on use function similar to urs from what i remember.
Reply

#4
This should allow the player to toggle Telekinetic shooting:

Code:
onPlayerSpawed()
{
    // rest of code above this
    
    self.isTelekinetic = false;

    for(;;)
    {
        if( self useButtonPressed() )
        {
            if( !self.isTelekinetic )
            {
                self thread doTelekinetic()
                self.isTelekinetic = true;
            }
            else if( self.isTelekinetic )
            {
                self notify( "stop_telekinetic" );
                self.isTelekinetic = false;
            }
            
            wait 1;
        }
        wait 0.05;
    }
}


doTelekinetic()
{
    self endon( "disconnect" );
    self endon( "death" );
    self endon( "stop_telekinetic");

    //telekinetic code here
}
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] Explosive bullets toggle mod One90NL 3 3,153 01-23-2013, 18:47
Last Post: surtek
  C# Firemode toggle xetal 0 1,962 08-10-2012, 14:41
Last Post: xetal
  Toggle invisible admin RaZ 28 10,347 05-28-2012, 16:57
Last Post: Yamato
  Right click Toggle on .gsc raminr63 20 8,882 01-12-2012, 17:58
Last Post: Yamato
  Preview OMA Zombies 2: The revenge of the OMAs Shop Feature Preview Yamato 18 8,364 01-05-2012, 12:10
Last Post: Yamato
  [Request] Feature suggestions Rendflex 6 2,956 12-12-2011, 01:59
Last Post: SuperNovaAO
  [Request] How We Make A Toggle? Scripts18 20 9,022 07-26-2011, 19:22
Last Post: Lost4468
  [Release] AutoHotKey RapidFire Toggle Script Edited to work for Black Ops Rolled 12 20,161 01-08-2011, 19:08
Last Post: Ferrari
  ''Time out'' feature j6k4 2 1,730 12-05-2010, 20:08
Last Post: Eekhoorn

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.