✓ Accepted answer
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.