Lua script for changing points

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
AdmiralSteve
Posts: 273
Joined: Mon Mar 28, 2011 2:32 pm
Location: Red Bluff, CA

Lua script for changing points

Post by AdmiralSteve »

I'm wanting to create a Special Action but I'm preferring a Lua script that can add/deduct points and be placed within the Special Action and thought that their was a script awhile ago but can't seem to locate it. Any ideas?

Thanks, Steve
“There are no extraordinary men...just extraordinary circumstances that ordinary men are forced to deal with.”
Admiral William Frederick Halsey Jr. 1882-1959

User avatar
KLAB
Posts: 366
Joined: Tue Feb 27, 2007 5:24 pm

RE: Lua script for changing points

Post by KLAB »

This works from one of my special action scripts but as ever there is probably a cleverer way of doing it, [:D]

a=ScenEdit_GetScore("Side A")
ScenEdit_SetScore('Side A',(a-4000),'-4000 Points for whatever')

k
User avatar
Kushan04
Posts: 694
Joined: Tue Jun 28, 2005 9:27 pm

RE: Lua script for changing points

Post by Kushan04 »

No need to assign the side as a variable unless you really need to.

ScenEdit_SetScore('YourSideHere', NumberOfPointsHere, 'ReasonHere')

Example
ScenEdit_SetScore('USA', 1000, 'You destroyed something')

http://commandlua.github.io/#ScenEdit_SetScore

KnightHawk75
Posts: 1556
Joined: Thu Nov 15, 2018 7:24 pm

RE: Lua script for changing points

Post by KnightHawk75 »

Image
see the example at the bottom of the function specs (though it doesn't need the tonumber() around it).
Post Reply

Return to “Lua Legion”