No categories assigned

LUA:GetSpawnByLocationID

Revision as of 18:24, 11 September 2013 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: GetSpawnByLocationID() = Gets a spawn in the given zone with the given location ID ==== Syntax ==== var = GetSpawnByLocationID(param1, param2) ==== Parameter...")
(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, Spawn2)
    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