Difference between revisions of "LUA:GetSpawnByGroupID"

(Created page with "= LUA Functions: GetSpawnByGroupID() = Gets a spawn in the given zone with the given group ID ==== Syntax ==== var = GetSpawnByGroupID(param1, param2) ==== Parameters ==== ; ...")
 
 
Line 18: Line 18:
 
     local zone = GetZone(Spawn)
 
     local zone = GetZone(Spawn)
 
     local Spawn2 = GetSpawnGroupByID(zone, 1234)
 
     local Spawn2 = GetSpawnGroupByID(zone, 1234)
     Attack(Spawn, Spawn2)
+
     Attack(Spawn2, Spawn)
 
end
 
end
 
</pre>
 
</pre>

Latest revision as of 18:24, 11 September 2013

LUA Functions: GetSpawnByGroupID()

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


Syntax

var = GetSpawnByGroupID(param1, param2)


Parameters

Required - param1 (Zone), param2 (int32)
param1 is the zone you want to look in for the given group
param2 is the ID of the group you want


Usage

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

When the NPC is hailed it will make the spawn group with an ID of 1234 attack the player

Notes

Returns a spawn