No categories assigned

LUA:CompareSpawns

Revision as of 17:32, 28 August 2013 by Jabantiz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: CompareSpawns()

Compares the given spawns


Syntax

CompareSpawns(param1, param2)


Parameters

Required - param1 (Spawn), param2 (Spawn)
param1 is the first spawn to compare
param2 is the second spawn to compare

Usage

function hailed(NPC, Spawn)
    local target = GetTarget(NPC)
    if target ~= nil and CompareSpawns(target, Spawn) then
        Say(NPC, "I have you targeted")
    end
end

This will have the spawn say whether the player who hailed it is also its target

Notes

Returns a bool, true if the spawns are the same.