No categories assigned

LUA:AddPrimaryEntityCommand

Revision as of 16:40, 15 October 2012 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: AddPrimaryEntityCommand() = Returns the current '''current hit points''' of ''param''. The parameter can be either a player or the NPC currently being interacted...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: AddPrimaryEntityCommand()

Returns the current current hit points of param. The parameter can be either a player or the NPC currently being interacted with.


Syntax

AddPrimaryEntityCommand(param1, param2, param3, [param4], [param5], [param6], [param7], [param8])

Parameters

Required - param1 (spawn), param2 (spawn), param3 (string)
param1 is the player who will see this new command on the given spawn, must be a player
param2 is the spawn that will get the new command
param3 is the name of the command
Optional - param4 (float), param5 (string), param6 (string), param7(int16), param8 (int32)
param4 is the max distance from the spawn to be able to use the command
param5 is the command
param6 is the error text for when the command fails
param7 is the time it takes to cast the command
param8 is the spell visual for this command


Usage

function hailed(NPC, Spawn)
    AddPrimaryEntityCommand(Spawn, NPC, "poke")
end

Add the poke command to the spawn for the player after they have hailed the spawn.


Notes

If left out param4 defaults to 10.

If left out param5 defaults to the same value as param3

param5 needs to be in the Commands table in the DB.