How to create an Ignore list?

Hi devs,

Basically to sum it up, I use Gravity Controller, which already has an Ignore list built in that ignore players so that you cannot walk on another player.

This is the code for it:

local ignoreList = {}
	for i, player in ipairs(Players:GetPlayers()) do
		ignoreList[i] = player.Character
	end

I am making this post because I want to add a folder into my Workspace that will house parts that I also want Ignored. For instance, Barriers and Invisible parts.

However, I am not sure how to do this. I have never used tables before, and I believe that is why I am having issues.

I believe that I need to create a new for - do loop? Or would I just be able to add the Folder into this loop?

If anyone can give me some insight and get me moving in the right direction, that’ll be great!

1 Like

You are in the right direction, but since you don’t know how to use Tables I would suggest you watch this video

1 Like
local ignoreList = {}
	
for i, player in ipairs(Players:GetPlayers()) do
   table.insert(ignoreList, player.Character)
end
4 Likes