How to detct if part touching isn't a player's Chracter?

So I have this part, do when another part touches it, it will weld to it, but if a player touches it it won’t weld. I am having trouble achieving this effect, every time the character would touch it, they would be welded to the part. Here is my code:

function touch(part)
	if part:IsA ("BasePart") and part.Name ~= "#Weight" and part.Name ~= "Baseplate" and part.Parent:FindFirstChild("Humanoid") == nil then
		local IsHuaman = part.Parent:FindFirstChild("Humanoid")
		warn(IsHuaman)
		if IsHuaman == nil then
			local w = Instance.new("Weld")
			w.Part0,w.Part1 = script.Parent.Platform,part
			w.C0 = part.CFrame:toObjectSpace(script.Parent.Platform.CFrame):Inverse()
			w.Parent = script.Parent.Platform
		end
	end
end

function UnWeld()
	print("Unwelding...")
	for i, v in pairs(Platform:GetChildren()) do
		if v.ClassName == "Weld" then
			if v.Part0 == Platform then
				v:Destroy()
			end
		end
	end
end

Platform.Touched:Connect(touch)
UnWeldEvent.OnServerEvent:Connect(UnWeld)

All help appreciated :smiley: Thank you.

Could you not do If not IsHuaman? If the humanoid object isn’t found it’ll return false but if it is it’ll return true, and lua might be sensitive when comparing false values.

Ok. I will try that thank you.

It is coming back as nil, but is still welding to the character.