so I am making a ragdoll system, the code below is changing the default joints into custom ones, but I want some joints to not be changed and I am using names to do that, so when I have done the if v.Name ~= "Neck"
it works but when I do something like if v.Name ~= "Neck" or v.Name ~= "RightWrist"
it just ignores it and won’t do the neck or wrist
if v:IsA("Motor6D") and char.Humanoid.RigType == Enum.HumanoidRigType.R15 then-- adding an attachment and constraint for each
if v.Name ~= "Neck" then
local attachment1 = Instance.new("Attachment")
local attachment0 = Instance.new("Attachment")
attachment0.Name = "Attachment0"
attachment1.Name = "Attachment1"
attachment0.CFrame = v.C0
attachment1.CFrame = v.C1
attachment0.Parent = v.Part0
attachment1.Parent = v.Part1
local constraint = Instance.new("BallSocketConstraint") -- change to BallSocketConstraint if you want
constraint.Attachment0 = attachment0
constraint.Attachment1 = attachment1
constraint.Parent = v.Part0
v:Destroy()
end
elseif v:IsA("Motor6D") and char.Humanoid.RigType == Enum.HumanoidRigType.R6 then
local attachment1 = Instance.new("Attachment")
local attachment0 = Instance.new("Attachment")
attachment0.Name = "Attachment0"
attachment1.Name = "Attachment1"
attachment0.CFrame = v.C0
attachment1.CFrame = v.C1
attachment0.Parent = v.Part0
attachment1.Parent = v.Part1
local constraint = Instance.new("BallSocketConstraint") -- change to BallSocketConstraint if you want
constraint.Attachment0 = attachment0
constraint.Attachment1 = attachment1
constraint.Parent = v.Part0
v.Part0 = nil
end
Thank you everyone a solution has been found and i now understand my mistake as many commenters have told me, thank you all.