Author Topic: Avatar Pref Change Loop  (Read 462 times)

What is the best way to make a function that sets all prefs to 1 then on a one second schedule sets it all to 0? I will now ashamedly post my relavent piece of clearly nonfunctional code.
Code: [Select]
function FunkyPlayerLoop()
{
$R=1;
$G=0;
        //Ikoa
      $pref::Avatar::RLeg=$R SPC $G SPC;
      $pref::Avatar::Accent=$R SPC $G SPC;
      $pref::Avatar::Hip=$R SPC $G SPC;
      $pref::Avatar::LHand=$R SPC $G SPC;
      $pref::Avatar::LArm=$R SPC $G SPC;
      $pref::Avatar::Rarm=$R SPC $G SPC;
        clientcmdupdateprefs();
        $FunkyPlayerCount++;
        $FunkyPlayer=schedule(1000,0,FunkyPlayerLoop);
}
I decided to re-purpose the rainbow player mod (I hope it is possible to do so) and I'm enjoying this (I hope) basic project

Make a global variable to keep track of wether it's time to set the values to 1 or 0.
Change the variable to 1 or 0 at the beginning of the function.
Change all the color values to that global variable.
Use the update pref function.
Use a schedule to call the function again after one second.