Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Receiving a random primary & secondary
#1
Currently I'm using a switch to give myself a weapon but it's been really annoying because I can't use a true random weapon generator. So I'm looking to spawn with a primary and secondary using a specific set of weapons. (Do note I did change up isValidAttachments so it returns no attachments at times, which is what I would also need.)
@Yamato told me to check out _class or use level.weaponlist (but the second one returns all weapons).

I was thinking of using tableLookUp or so but I have no idea on how to use such functions.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#2
This is how I did it in MW2
http://pastebin.com/67kLFCnk
Change weapon names and attachment names and it should be the same.
It doesn't give you a random secondary, but you can easily make it so.
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#3
Yup I see it, thanks!


Edit: This thread can be locked it's finished Smile
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#4
Code:
weap = random(level.weaponlist);

????
[Image: b_560_95_1.png]
Reply

#5
(07-22-2013, 04:49)Nukem Wrote:
Code:
weap = random(level.weaponlist);

????

That's all the weapons in the game, I wanted to use a specific set. I was too lazy to actually make more checks for if the weapon was a primary/secondary.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#6
(07-22-2013, 05:10)DidUknowiPwn Wrote:
(07-22-2013, 04:49)Nukem Wrote:
Code:
weap = random(level.weaponlist);

????

That's all the weapons in the game, I wanted to use a specific set. I was too lazy to actually make more checks for if the weapon was a primary/secondary.

But the code might be shorter Cool
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 4,104 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,696 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Help choose 2 random players?(1 each team) 26hz 6 4,642 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,253 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,731 07-27-2013, 23:53
Last Post: DidUknowiPwn
  What script controls the "random" aspect to care packages? akillj 2 3,260 06-05-2013, 11:24
Last Post: akillj
  Random anims master131 14 10,790 05-24-2013, 09:45
Last Post: [HARD] Tony.
  [Request] Random player model hillbilly 1 2,741 05-12-2013, 08:30
Last Post: archit
  [Release] Random Functions 1.1 Yamato 22 13,366 04-20-2013, 10:13
Last Post: Dominator56
Question Akimbo Primary Weapons Kasperle 4 3,578 11-17-2012, 13:13
Last Post: 8q4s8

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.