Difference between revisions of "LUA:GetSpawnByLocationID"
(Created page with "= LUA Functions: GetSpawnByLocationID() = Gets a spawn in the given zone with the given location ID ==== Syntax ==== var = GetSpawnByLocationID(param1, param2) ==== Parameter...") |
|||
| Line 17: | Line 17: | ||
function hailed(NPC, Spawn) | function hailed(NPC, Spawn) | ||
local zone = GetZone(Spawn) | local zone = GetZone(Spawn) | ||
| − | local Spawn2 = GetSpawnByLocationID(zone, | + | local Spawn2 = GetSpawnByLocationID(zone, 1234) |
Attack(Spawn2, Spawn) | Attack(Spawn2, Spawn) | ||
end | end | ||
Latest revision as of 03:04, 22 January 2017
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