Author Topic: Rainbow hat  (Read 1179 times)

I don't know what went wrong here. It was working fine until I added in the random values for the hat color. I didn't write/understand this script enough to really debug it. the rainbowplayerloop function doesn't seem to be executing because i'm not getting any echos in the console.Nevermind, I fixed it myself.
Code: [Select]
if (!$RainbowPlayerBindings)
{
   $remapDivision[$remapCount] = "Rainbow Player";
   $remapName[$remapCount] = "Activate/Deacticate";
   $remapCmd[$remapCount] = "RainbowPlayerToggle";
   $remapCount++;
   $RainbowPlayerBindings=true;
}

$RainbowPlayerCount=0;
$RainbowPlayerFlag=0;
$RainbowPlayerTempHat=$pref::Avatar::HatColor;

function RainbowPlayerToggle(%val)
{
if(%val)
{
     if($RainbowPlayerFlag==0)
   {
         $RainbowPlayerFlag=1;
       $RainbowPlayerTempHat=$pref::Avatar::HatColor;
       RainbowPlayerLoop();
     }
   else if($RainbowPlayerFlag==1)
   {
         $RainbowPlayerFlag=0;
       cancel($RainbowPlayer);
       $pref::Avatar::HatColor=$RainbowPlayerTempHat;
         clientcmdupdateprefs();
     }
  }
}

function rainbowreset()
{
cancel($RainbowPlayer);
$pref::Avatar::HatColor=$RainbowPlayerTempHat;
clientcmdupdateprefs();
}

function RainbowPlayerLoop()
{
$R = getrandom(225);
$G = getrandom(225);
$B = getrandom(225);
     $pref::Avatar::HatColor=$R SPC $G SPC $B SPC "1";    
        clientcmdupdateprefs();
echo($R);
echo($G);
echo($B);
        $RainbowPlayer=schedule(1000,0,RainbowPlayerLoop);
}
« Last Edit: July 17, 2010, 02:19:54 PM by Deriboy »

Another stupid rainbow avatar script
THEY DONT WORK AND THEY SUCK

why exactly do you want to echo their values anyways? unless you enjoy your console being spammed with numbers..

Another stupid rainbow avatar script
THEY DONT WORK AND THEY SUCK

Really. All Badspot did was limit the amount of changes on an avatar in a second I belive. IT still works. I have a modded one that is blue, and it flashes.

Another stupid rainbow avatar script
THEY DONT WORK AND THEY SUCK
Don't post if you're not going to help

Another stupid rainbow avatar script
THEY DONT WORK AND THEY SUCK
Do you even know how to script?
why exactly do you want to echo their values anyways? unless you enjoy your console being spammed with numbers..
I put those there to test what was wrong with it. I'll remove them when I fix the problem. The values aren't even echoing though.