SetLocalValue: Difference between revisions
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Welcome|desc=Sets local value like health or armour of npc. Can be used before calling [[ | {{Welcome|desc=Sets local value like health or armour of npc. Can be used before calling [[SendOnFootSyncDataLV]] which sends an onfoot player (npc) update packet to server| | ||
params=<syntaxhighlight lang="lua">(field, value)</syntaxhighlight> | params=<syntaxhighlight lang="lua">(field, value)</syntaxhighlight> | ||
<poem>::field : The [[field]] of npc's data to which the value is to be set | <poem>::field : The [[field]] of npc's data to which the value is to be set | ||
Line 5: | Line 5: | ||
retvals=<poem>null, if the function fails, i.e. invalid field or type of value. | retvals=<poem>null, if the function fails, i.e. invalid field or type of value. | ||
true, if the function succeed.</poem>| | true, if the function succeed.</poem>| | ||
relfuncs= *[[ | relfuncs= *[[SendOnFootSyncDataLV]] | ||
*[[GetLocalValue]]| | |||
note=A call to the SetLocalValue without a post call to SendOnFootSyncDataLV affects the functions GetPlayerHealth, GetPlayerArmedWeapon etc as they will return the value (health for example) which may not be the actual health seen in the health bar at this point. | |||
}} | }} |
Latest revision as of 16:59, 21 August 2023
Description:
Sets local value like health or armour of npc. Can be used before calling SendOnFootSyncDataLV which sends an onfoot player (npc) update packet to server
Parameters:
(field, value)
field : The field of npc's data to which the value is to be set
value : ( float ) The value to be set.
Return Values:
null, if the function fails, i.e. invalid field or type of value.
true, if the function succeed.
Important Note:
A call to the SetLocalValue without a post call to SendOnFootSyncDataLV affects the functions GetPlayerHealth, GetPlayerArmedWeapon etc as they will return the value (health for example) which may not be the actual health seen in the health bar at this point.
Related Functions
The following functions may be helpful as they relate to this function in one way or another.