Difference between revisions of "IsOffLimits - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
Line 17: Line 17:


<source lang="papyrus">
<source lang="papyrus">
ObjectReference Property weaponRef Auto
ObjectReference ErikursBooze boozeRef Auto
Float charge


Function setWeaponcharge()
Function takeButDontSteal()
Charge = weaponRef.GetItemCharge()
if boozeRef.IsOffLimits()
weaponref.SetItemCharge((Charge + 100.0)); Adds 100 to the Current Charge.
boozeRef.Activate(playerRef) ; takes it
endif
EndFunction
EndFunction
</source>
</source>
*Do note that this will only work on a weapon that is currently loaded and not in a container.


== Notes ==
== Notes ==

Revision as of 17:07, 8 April 2022

SKSE Member of: ObjectReference Script

This Function will set a ObjectReference's charge to the specified amount.

Syntax

Bool Function IsOffLimits() native

Parameters

  • charge - The amount, as a float you wish to set the Objects charge to.

Examples

ObjectReference ErikursBooze boozeRef Auto

Function takeButDontSteal()
	if boozeRef.IsOffLimits()
		boozeRef.Activate(playerRef) ; takes it
	endif
EndFunction

Notes

  • This function can only be run on items outside of containers, as when they are put into containers member functions cannot be called on them.

See Also