Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to locate joint instances?

Asked by
Gumbyz 0
8 years ago

I've been trying to use an object to breakjoints on any object containing them, not just players. What do I have to specifically search for, and how?

the code so far will only work for objects containing a humanoid:

script.Parent.Touched:connect(function(hit)

    if script.Parent.Transparency == 1 then return end



    if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:BreakJoints()

end

end )

1 answer

Log in to vote
0
Answered by 8 years ago

Well yes, of course...

script.Parent.Touched:connect(function(hit)
    if script.Parent.Transparency == 1 then return end
    if hit.Parent:FindFirstChild("Humanoid") then --this checks if what touched has a humanoid, and only breaks joints if that is true, so just change this so that it searches for a joint
        hit.Parent:BreakJoints()
    end
end
Ad

Answer this question