[Command] modifyActorVar

Post Reply
User avatar
Raddeck
LP Manager
Reactions: 1
Posts: 508
Joined: Sat Oct 16, 2021 6:22 pm
Location: LpWorld
Contact:

Post by Raddeck »

{Actor}.modifyActorVar(name, value)


USE:
Use this function to modify the float value of a variable by a given value.
The actor can be the Player or any other actor.

This function was introduced with LifePlay 2.18.


TYPE: Command, Non-Ref (ref-like syntax)
RETURNS: /
THEME: Variables
COMPARE: getActorVar, modifyActorVar


EXAMPLE:

Code: Select all

    Player.setActorVar(SomeVariable, 42)     // Set the variable to 42
    Player.modifyActorVar(SomeVariable, 1)
    val = Player.getActorVar(SomeVariable)
    "The value of SomeVariable is <val>."   // Will be 43
    
    Player.modifyActorVar(SomeVariable, -30)
    val = Player.getActorVar(SomeVariable)
    "The value of SomeVariable is <val>."   // Will be 13
Like my work? Buy me a coffee or support me on Patreon to keep it coming. :ugeek:
-Don't PM me for support-
Top
Post Reply