Page 1 of 1

Lua script for changing points

Posted: Sun Aug 29, 2021 11:14 am
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

RE: Lua script for changing points

Posted: Mon Aug 30, 2021 9:53 am
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

RE: Lua script for changing points

Posted: Mon Aug 30, 2021 1:42 pm
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


RE: Lua script for changing points

Posted: Mon Aug 30, 2021 3:18 pm
by KnightHawk75
Image
see the example at the bottom of the function specs (though it doesn't need the tonumber() around it).