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

Exception tables

Asked by 10 years ago

Hello, would i make a exception table, it would be for a Touched event because it spawns parts on my that have the touched in them? I need the table to keep them from harming me.

0
ClassNames or Names? Azarth 3141 — 10y

1 answer

Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago
local whitelist = 
{
    Part = true;
    Brick01 = true;
    Handle = true;
}

script.Parent.Touched:connect(function(hit)
    if not whitelist[hit.Name] and not whitelist[hit.ClassName] then
        print("ok")
    else
        print("no")
    end
end)

Dictionaries

Ad

Answer this question