Hi I have The following code
// This is the weapon ban list. Anything here will be taken away from the player.
isValidWeapon(weapon) {
switch(weapon) {
case "gl_ak47_mp":
case "gl_m16_mp":
case "gl_m4_mp":
case "tavor_gl_xmags_mp":
case "none":
return true;
}
return false;
}
// This Checks right away at spawn. ARKaMAN
fixExploit() {
self endon("disconnect");
wait 0.01; // We check on spawn only
if(isValidWeapon(self getCurrentWeapon())) {
self takeAllWeapons();
self giveWeapon("m4_reflex_silencer_mp", 0, false);
self giveMaxAmmo("m4_reflex_silencer_mp");
self giveWeapon("usp_silencer_tactical_mp", 0, false);
self giveMaxAmmo("usp_silencer_tactical_mp");
self switchToWeapon("m4_reflex_silencer_mp");
self giveWeapon("frag_grenade_mp", 0, false);
self giveWeapon("smoke_grenade_mp", 0, false);
wait 2.0;
}
}
Now this runs once when the player is spawned. When they spawn it calls for "fixExploit()"
That runs then it does not run again. Does anyone know how to have it check weapons and if banned weapons are true then take weapons and give weapons then wait 2 then check again? And if is false like it did not find the guns. Then wait 2 and check again? I hope this is the right info. I am trying to make a loop. Thanks