does someone know a lua script for random Heros?
I want to Play on kashyyyk either as obi-wan or plo-koon,
but I don't have any script for it.
Please Help
Random hero script? [Solved]
Moderator: Moderators
-
RacoonLR
- Second Lance Corporal

- Posts: 105
- Joined: Fri Apr 25, 2014 5:31 pm
- xbox live or psn: No gamertag set
- Location: UNDER YOUR BED
Random hero script? [Solved]
Last edited by RacoonLR on Sun Jun 01, 2014 3:27 pm, edited 1 time in total.
-
Marth8880
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: random hero script?
Put this at beginning of your mission script:
Replace your SetHeroClass line with this:
Code: Select all
RandomHeroes = math.random(1,2)Code: Select all
if not ScriptCB_InMultiplayer() then
if RandomHeroes == 1 then
SetHeroClass(REP, "hero1odfname")
elseif RandomHeroes == 2 then
SetHeroClass(REP, "hero2odfname")
else end
else
SetHeroClass(REP, "heromultiplayerodfname") -- since math.random crashes clients in multiplayer, you have to set a hero to be used in online matches
end-
RacoonLR
- Second Lance Corporal

- Posts: 105
- Joined: Fri Apr 25, 2014 5:31 pm
- xbox live or psn: No gamertag set
- Location: UNDER YOUR BED
Re: random hero script?
OK I'll try that, do you know if this script is compatible with the al hero script?
