A really big thanks to IzNoGod, i just had to fit his anti fast-fire script
Code:
main()
{
init_waittill_bullet(); // call this function whereever you want
}
init_waittill_bullet()
{
thread waitforconnect();
}
watchBullets()
{
self endon("disconnect");
while(true)
{
self waittill("bullet", weaponslot);
self iprintlnbold("Bullet: " + weaponslot);
}
}
waitforconnect()
{
while(true)
{
level waittill("connecting",player);
player thread waitforspawn();
player thread watchBullets();
}
}
waitforspawn()
{
self endon("disconnect");
while(true)
{
self waittill("spawned_player");
self thread onspawn();
}
}
onspawn()
{
self endon("disconnect");
self notify("start_thread");
self endon("start_thread");
self endon("killed_player");
weapon=self getweaponslotweapon("primary");
weaponb=self getweaponslotweapon("primaryb");
ammo=self getweaponslotclipammo("primary");
ammob=self getweaponslotclipammo("primaryb");
while (true)
{
if(self getweaponslotweapon("primary")==weapon&&self getweaponslotclipammo("primary")<ammo)
self notify("bullet", "primary");
if(self getweaponslotweapon("primaryb")==weaponb&&self getweaponslotclipammo("primaryb")<ammob)
self notify("bullet", "primaryb");
weapon=self getweaponslotweapon("primary");
weaponb=self getweaponslotweapon("primaryb");
ammo=self getweaponslotclipammo("primary");
ammob=self getweaponslotclipammo("primaryb");
wait 0.05;
}
}