I am new to lua tables, after googling for a while to figure out how to even get arrays to work they make it clear that lua does not have arrays it has tables and it seems far more complicated then a simple array is, although I have been working with arrays for years now so I am biased, I bring this up so if others google they know to search lua tables and not lua arrays.
That said I used your script and fixed a few errors and it works.
Code: Select all
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
I am still learning stuff about lua tables but for our needs I think this basic use is a good start.