Difference between revisions of "LUA:GetGroup"
(Created page with "= LUA Functions: GetGroup() = Returns a lua table (array) of all the spawns in the given spawns group. ==== Syntax ==== var = GetGroup(param1) ==== Parameters ==== ; Require...") |
(No difference)
|
Latest revision as of 16:16, 17 October 2012
LUA Functions: GetGroup()
Returns a lua table (array) of all the spawns in the given spawns group.
Syntax
var = GetGroup(param1)
Parameters
- Required - param1 (Spawn)
- param1 is the spawn we are getiing group members from
Usage
function hailed(NPC, Spawn)
var = GetGroup(Spawn)
if var == nil then
Say(NPC, "I do not speak to loners...")
else
FaceTarget(NPC, Spawn)
for k,v in ipairs(var) do
Say(NPC, GetName(v))
end
end
end
This makes the NPC say the name of every player in the group, or if the player is not grouped the npc says "I do not speak to loners..."
Notes
This works for both player groups and spawn groups.