No categories assigned

LUA:GetSpawnByLocationID

Revision as of 03:04, 22 January 2017 by Cynnar (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: GetSpawnByLocationID()

Gets a spawn in the given zone with the given location ID


Syntax

var = GetSpawnByLocationID(param1, param2)


Parameters

Required - param1 (Zone), param2 (int32)
param1 is the zone we want to look in
param2 is the location ID we want to get


Usage

function hailed(NPC, Spawn)
    local zone = GetZone(Spawn)
    local Spawn2 = GetSpawnByLocationID(zone, 1234)
    Attack(Spawn2, Spawn)
end

When this NPC is hailed it will force the spawn with a location ID of 1234 to attack the player

Notes

Returns a spawn