DWReese -> RE: Lua Help.....randomize the deletion of a unit (6/11/2017 9:41:01 PM)
|
I just discovered a problem with my Special Action for my scenario. Here is what I have so far: local g = math.random(1,10) if g <= 7 then ScenEdit_DeleteUnit({side="Iran", unitname="SA-20a Gargoyle"}) a=ScenEdit_GetScore("Israel") ScenEdit_SetScore('Israel',(a-500),'-500 Points for Suppressing SA-20a bn') end It is working fine as long as the random roll was 7 or below. If not, then, of course, the unit does not get deleted. What I would like is if you select this Special Action, I still want you to have to pay the 500 Victory Points, regardless of what randomized number occurs. So, by paying the 500 VP, you have a CHANCE to delete the unit. What changes should I make to make this happen? Thanks in advance. Doug
|
|
|
|