For some reason this code doesn't work. Is there another way?
It's supposed to do the 'stuff' to everything (from i, v in pairs) as long as it's name is not whatever is in the list.
if v.Name ~= {"PrimaryPart", "Head", "HumanoidRootPart"} then -- stuff end
Well what your doing is comparing a string to a table, if you want to check if a string is inside a table we will have to go through each one and check individually
local t = {"PrimaryPart", "Head", "HumanoidRootPart"} local checkname="string" local isin=false for _,v in pairs(t) do if v==checkname then isin=true end end if isin==true then print('run') end
Here I set up a variable and then made a for loop to go through each string in the table, if the current string is the same as the string we are checking it makes a bool variable true.