Posts: 916
Threads: 65
Joined: Jun 2011
For example
I have
weapons[] = [];
weapons[1]= "shit_sp"
weapons[2]= "poo_sp"
and
weapons2[] = [];
weapons2[1]= "test_sp"
weapons2[2]= "wazza_sp"
weapon = weapons[RandomInt(weapons.size)];
weapon2 = weapons2[RandomInt(weapons2.size)];
can I add another random that select one of those 2 list randomly?
Posts: 916
Threads: 65
Joined: Jun 2011
08-05-2011, 20:22
(This post was last modified: 08-05-2011, 20:25 by Scripts18.)
(08-05-2011, 20:11)koil Wrote: Code:
derp[] = [];
derp[1]= "shit_sp"
derp[2]= "poo_sp"
derp[3]= "test_sp"
derp[4]= "wazza_sp"
derp1 = derp[RandomInt(derp.size)];
this?
OR
Code:
weapon[] = [];
weapon[1] = weapons[RandomInt(weapons.size)];
weapon[2] = weapons2[RandomInt(weapons2.size)];
weapon = weapon[RandomInt(weapon.size)];
Never needed to use rand ints, but by the look of how you done it they should work?
I will use 2nd thx (seems to be he best)
hum how I am gonna give me the weapon?
Posts: 916
Threads: 65
Joined: Jun 2011
(08-05-2011, 20:24)koil Wrote: np, atleast i know how to make rand weapon selection now
hum how am I gonna give myself the weapon with your code?
Posts: 474
Threads: 67
Joined: May 2011
Reputation:
11
take all weapons - if u need to.. then just..
self giveweapon( weapon );
should work?
Posts: 916
Threads: 65
Joined: Jun 2011
(08-05-2011, 20:27)koil Wrote: take all weapons - if u need to.. then just..
self giveweapon( weapon );
should work?
lol nvm your code doesnt work I get unitialised varaible for the weapons in
weapons[RandomInt(weapons.size)];
Posts: 474
Threads: 67
Joined: May 2011
Reputation:
11
does ur original post work?
Posts: 916
Threads: 65
Joined: Jun 2011
(08-05-2011, 20:40)koil Wrote: does ur original post work?
yep
Posts: 474
Threads: 67
Joined: May 2011
Reputation:
11
weapons[] = [];
weapons[1]= "shit_sp"
weapons[2]= "poo_sp"
weapons2[] = [];
weapons2[1]= "test_sp"
weapons2[2]= "wazza_sp"
weapon[] = [];
weapon[1] = weapons[RandomInt(weapons.size)];
weapon[2] = weapons2[RandomInt(weapons2.size)];
endweapon = undefined;
endweapon = weapon[RandomInt(weapon.size)];
self giveweapon( endweapon );
Try that.