Post: Two Button Handling Scripts
10-10-2011, 08:21 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); Button handling #1- using waittills
    
buttonFormatOne()
{
self endon("death");
self endon("disconnect");
for( ;; )
{
if (self fragButtonPressed())
{
self notify("Pressed_R2");
wait .02;
}
if (self secondaryOffHandButtonPressed())
{
self notify("Pressed_L2");
wait .02;
}
if (self attackButtonPressed())
{
self notify("Pressed_R1");
wait .02;
}
if (self adsButtonPressed())
{
self notify("Pressed_L1");
wait .02;
}
if (self meleeButtonPressed())
{
self notify("Pressed_R3");
wait .02;
}
if (self usedButtonPressed())
{
self notify("Pressed_Sqaure");
wait .02;
}
wait .3;

}
}


use the button like this..
    
self waittill("Pressed_Sqaure");
self thread aFunction();


Button Handling #2- Straight of buttons
    
buttonFormatTwo()
{
self endon("death");
self endon("disconnect");
while(1)
{

if (self fragButtonPressed())
{
self thread _orAction();
}
if (self secondaryOffHandButtonPressed())
{
self thread _orAction();
}
if (self attackButtonPressed())
{
self thread _orAction();
}
if (self adsButtonPressed())
{
self thread _orAction();
}
if (self meleeButtonPressed())
{
self thread _orAction();
}
if (self usedButtonPressed())
{
self thread _orAction();
}
wait .3;

}
}


code the functions within the buttons.
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo