How to get the oposite

Basically, i have a script that will put the value to nil. But somehow the oposite doesnt work:

function pes()
if not script.Parent:IsDescendantOf(workspace.Placing) then
local v = script.Parent.Parent
for g,a in pairs(v:GetChildren()) do
for l,m in pairs(a:GetChildren()) do
if m:IsA("Part") then
local seatt = m:GetConnectedParts(true)
	if a:IsA("Model") then
		local yease = table.find(seatt,a.PrimaryPart)
		if not yease then
			a.IsSeat.Value = ""
			a.Parent = workspace.PlacedObjects
		else --this doesnt work
			a.IsSeat.Value = v.Name
			a.Parent = v
		end
	end
	end
end end 
end
end

game:GetService("RunService").Heartbeat:Connect(pes)

Sorry I’m not understanding, what is “oposite” supposed to be?

Try doing,
if yease ~= nil then
–code
elseif yease == nil then
–code
end

Can you be more specific? What do you mean when you say that your code “doesn’t work”? Are there any error messages in the output?

What i am trying to do is if it finds the object in the table, it sets that object’s “IsSeat” value to v.

But somehow it can only see if it is not there. sorry for not replying earlier

There are no error messages that are in the output.

When table.find can’t found a value inside a table, it does not return false, and instead returns nil.

still doesnt work‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎