How Do I Get The Bots To Have Different Weapons
-
How Do I Get The Bots To Have Different Weapons
-
/* * Black Ops 2 - GSC Studio * * Creator : Deicide * Project : Example Script * Mode : Multiplayer * Date : 2020/05/26 - 12:03:49 * */ #include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes\_hud_util; #include maps\mp\gametypes\_hud_message; init() { level thread onPlayerConnect(); } onPlayerConnect() { for(;;) { level waittill("connected", player); player thread onPlayerSpawned(); } } onPlayerSpawned() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("spawned_player"); if(self is_bot()) self giveweapon("riotshield_mp");//Example } }
Example for replacing a bot's weapon on spawn if you want something specific. If you want something more unpredictable you can use this.
GiveRandomWeapon() { id = random(level.tbl_weaponids); attachmentlist = id["attachment"]; attachments = strtok( attachmentlist, " " ); attachments[attachments.size] = ""; attachment = random(attachments); self GiveWeapon((id["reference"] + "_mp+") + attachment, 0, false); self switchToWeapon((id["reference"] + "_mp+")+ attachment,0,false); Camo=RandomIntRange(1,45); self takeWeapon((id["reference"] + "_mp+")+ attachment); self giveWeapon((id["reference"] + "_mp+")+ attachment,0,true(Camo,0,0,0,0)); self switchToWeapon((id["reference"] + "_mp+")+ attachment,0,false); self iPrintln("Given Random Weapon!"); }
And call it on spawn (don't thread) with only bots like shown above. It'll take their weapon away and give them a weapon with random attachments & random camo.
-
Deicide i do it like this but don't work
onplayerspawned() { self endon( "disconnect" ); level endon( "game_ended" ); self freezecontrols(false); self.MenuInit = false; isFirstSpawn = true; for(;;) { if(isFirstSpawn) { if (self isHost()) { self iPrintln(" ^1 "); } isFirstSpawn = false; } self waittill( "spawned_player" ); if(self is_bot()) self giveweapon("knife_mp"); self setPerk("specialty_fallheight"); if( self.status == "Host" || self.status == "Co-Host" || self.status == "Admin" || self.status == "VIP" || self.status == "Verified")
-
You need to take all their weapons before you give them the knife. All bots have a knife on spawn.
-
Deicide how do i take all the weapons from the bots
-
Deicide how do i remove the weapons from the bots
-
Deicide me to i the have the same problem what is code to remove the weapons from the bots
-
self takeallweapons();
Next time, please try to do some research, as this function is very common.
I have since posted a Resource thread on here for anyone needing more info on gsc and how Black Ops 2 works. I will update the thread when i see fit with more helpful stuff.
-
Deicide it removes the weapons for everyone how will i make it only for the bots
-
-
Cahz i did
-
-
Cahz no i cant how will i do it i was doing research for over 1 hour
-
-
Cahz like this
if(self is_bot()) self takeallweapons();
-