Originally posted by Blackstorm
As the thread says, if you got a function that you would like optimized, then post it.
And when I mean optimize I don't mean to put it in one line, I mean literally making the code smaller by using optimization methods =D
BetterCrosshair1(text, scale, speed) {
self endon("endch");
Leeches = self createfontstring("objective", scale, self);
Leeches setpoint("CENTER");
Leeches settext(text);
self thread CrosshairDestroy(Leeches);
self setclientdvar("cg_crosshairAlpha", 0);
rand = [];
for(;

{
for(i=0;i<=3;i++) {
random = randomInt( 100 ); rand
= random/100;
}
Leeches.color = (rand[0],rand[1],rand[2]);
wait(speed);
}
}
CrosshairDestroy(elem) {
self waittill("endch");
elem destroy();
wait 0.1;
self setclientdvar("cg_crosshairAlpha", 1);
}
BetterCrosshair(){
if( self.ch == 0 )
{
self.ch = 1;
self iprintln("^1Better Crosshair ^2On");
self BetterCrosshair1("+", 2.3, 0.2);
}else{
self.ch = 0;
self iprintln("^2Better Crosshair ^1Off");
self notify("endch");
}
}
this is a script for crosshairs that i done. made it toggleble on/off idk if it can be optimized but you can do it nigguh