Difference between revisions of "ForceActorValue - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
 
imported>JustinOther
m (→‎Examples: Floatified afNewValue)
Line 21: Line 21:
<source lang="papyrus">
<source lang="papyrus">
; Force the player's health to 50
; Force the player's health to 50
Game.GetPlayer().ForceActorValue("health", 50)
Game.GetPlayer().ForceActorValue("health", 50.0)
</source>
</source>
<br/>
<br/>
<source lang="papyrus">
<source lang="papyrus">
; Force Jake's health to 10
; Force Jake's health to 10
Jake.ForceAV("Health", 10)
Jake.ForceAV("Health", 10.0)
</source>
</source>



Revision as of 14:05, 8 October 2012

Member of: Actor Script

Forces the specified actor value to the passed-in value.

Syntax

Function ForceActorValue(string asValueName, float afNewValue) native
Function ForceAV(string asValueName, float afNewValue)

Parameters

  • asValueName: The name of the actor value to force. Actor Value List
  • afNewValue: The new value to force the actor value to.

Return Value

None.

Examples

; Force the player's health to 50
Game.GetPlayer().ForceActorValue("health", 50.0)


; Force Jake's health to 10
Jake.ForceAV("Health", 10.0)

See Also