lua to add or lose points

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
orca
Posts: 545
Joined: Wed Nov 06, 2013 4:59 pm

lua to add or lose points

Post 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
User avatar
KLAB
Posts: 501
Joined: Tue Feb 27, 2007 5:24 pm

RE: lua to add or lose points

Post 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
Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: lua to add or lose points

Post by Rory Noonan »

Check the standalones that come with C:MO; there is a function in the LuaInit scripts called ChangeScore [:)]
Image
Post Reply

Return to “Lua Legion”