Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

attempt to index function with 'name' ?

for key, value in pairs(GList) do
if PlrN:IsInGroup(value['name']) then	-- (error here)

print("player is in one of the listed groups")

end

1 answer

✓ Accepted answer

Your syntax is a bit off...

You're trying to index the value with a string.

You should be trying to index the table with the key(index)

Like so...

for index, value in pairs(GList) do
	if PlrN:IsInGroup(GList[index]) then
		print(PlrN.Name.." Is In "..value) --// Will print something like this "killerbrenden Is In A Group"
	end
end

Hope this helped! Feel free to select this as an answer if this helped you!

This discussion is preserved as it was. New answers, comments, and votes are closed.