No categories assigned
LUA:GetGroup
- Last edited 13 years ago by I need to Update My Profile
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.