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

Is there a "Ignore list" On a touched event (part) ?

Asked by 5 years ago

i have made a script that basically clones something to the player if "hit.Parent.Torso" exists, but it always hits an accesory (sometimes), so is there a ignore list for the touched event?

1 answer

Log in to vote
0
Answered by 5 years ago

You would just have to include an additional check. Something like this to keep looking for a model.

local function getModel(hit)
    while hit and not hit.ClassName == "Model" do
        hit = hit.Parent
    end
    return hit
end

There is an event which may even be better for you. The Humanoid includes a event called Touched.

Hope this helps.

0
tysm yes jdm4llfem8 94 — 5y
Ad

Answer this question