Page 1 of 1

lua to add or lose points

Posted: Fri Sep 25, 2020 1:21 am
by orca
Is there a LUA code to add or lose points to a side?

The reason is that I want to create a special action that costs a side a certain number of points and results in the loss of comms of the enemy satellites.

thanks

RE: lua to add or lose points

Posted: Fri Sep 25, 2020 8:11 am
by KLAB
a=ScenEdit_GetScore("YOUR SIDE")
ScenEdit_SetScore('YOUR SIDE',(a-500),'-500 Points)

a=ScenEdit_GetScore("YOUR SIDE")
ScenEdit_SetScore('YOUR SIDE',(a+500),'+500 Points)


This was "borrowed" shamelessly from the Sultan of Socotra LUA but works in one of my scenarios?

May be something better out there?

Cheers

K

RE: lua to add or lose points

Posted: Sun Oct 04, 2020 10:06 pm
by Rory Noonan
Check the standalones that come with C:MO; there is a function in the LuaInit scripts called ChangeScore [:)]