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 4,455 01-23-2013, 18:47
Last Post: surtek
  C# Firemode toggle xetal 0 2,909 08-10-2012, 14:41
Last Post: xetal
  Toggle invisible admin RaZ 28 16,328 05-28-2012, 16:57
Last Post: Yamato
  Right click Toggle on .gsc raminr63 20 14,215 01-12-2012, 17:58
Last Post: Yamato
  Preview OMA Zombies 2: The revenge of the OMAs Shop Feature Preview Yamato 18 12,811 01-05-2012, 12:10
Last Post: Yamato
  [Request] Feature suggestions Rendflex 6 4,663 12-12-2011, 01:59
Last Post: SuperNovaAO
  [Request] How We Make A Toggle? Scripts18 20 14,275 07-26-2011, 19:22
Last Post: Lost4468
  [Release] AutoHotKey RapidFire Toggle Script Edited to work for Black Ops Rolled 12 23,949 01-08-2011, 19:08
Last Post: Ferrari
  ''Time out'' feature j6k4 2 2,916 12-05-2010, 20:08
Last Post: Eekhoorn

Forum Jump:


Users browsing this thread:
1 Guest(s)

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