These functions will handle the weapon swap but you will need to do extra stuff to ensure that the player is actually trying to swap weapons with the AI
Code Snippet
Plaintext
/* Sets the Ai's primary weapon to the weapon passed <Required>: player- a player to swap weapons with the AI <Required>: AI- an AI that will swap weapons with the Player */ doWeaponSwap( player, AI) { //save the weapons AINewWeapon = player GetCurrentWeapon(); PlayerNewWeapon = ai.weapon;
//perform the swap setAiWeapon(AINewWeapon); swapPlayerCurrentWeapon(PlayerNewWeapon); }
/* Sets the Ai's primary weapon to the weapon passed <Required>: self- an AI <Required>: weapon - string representing the weapon that will be given to the Ai */ setAiWeapon( weapon ) {
/* Sets the player's primary weapon to the weapon passed <Required>: self- a player <Required>: weapon - string representing the weapon that will be given to the player */ swapPlayerCurrentWeapon(weapon) {
If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
These functions will handle the weapon swap but you will need to do extra stuff to ensure that the player is actually trying to swap weapons with the AI
Code Snippet
Plaintext
/* Sets the Ai's primary weapon to the weapon passed <Required>: player- a player to swap weapons with the AI <Required>: AI- an AI that will swap weapons with the Player */ doWeaponSwap( player, AI) { //save the weapons AINewWeapon = player GetCurrentWeapon(); PlayerNewWeapon = ai.weapon;
//perform the swap setAiWeapon(AINewWeapon); swapPlayerCurrentWeapon(PlayerNewWeapon); }
/* Sets the Ai's primary weapon to the weapon passed <Required>: self- an AI <Required>: weapon - string representing the weapon that will be given to the Ai */ setAiWeapon( weapon ) {
/* Sets the player's primary weapon to the weapon passed <Required>: self- a player <Required>: weapon - string representing the weapon that will be given to the player */ swapPlayerCurrentWeapon(weapon) {
Not tracking ammo so this will create a glitch that always refills your gun
Not checking if the gun swapping is the gun he has already
If using my perks that will breakvthe inventory
The point was to give him the idea of how to do it, not write it line by line for him. There's a lot that it doesn't account for that it needs be checking.
The point was to give him the idea of how to do it, not write it line by line for him. There's a lot that it doesn't account for that it needs be checking.
and my “point” was highlighting what’s not handled for him
and my “point” was highlighting what’s not handled for him
Problem?
Ok first of all...can we not argue...2nd of all...why cant i get a working script that someone can teach how to do it? I mean this is a help forum after so why are you just giving me scripts that i have no idea what to do with?
yes how dare you provide him with "most" of the answer and not just do the entire thing "for him"
how dare you
Ok...thats not what i meant...I don't need you're sarcasm. I can't making fucking scripts because i have no idea how to do so...and most importantly set the scripts up. All im asking is how to properly set it up so then i know how to do it in the future.