Make a table for whitelisted people, and loop through table to find if player who stepped are included in whitelist table or not.
local Whitelist = {"Player1", "Player2", ...}
[BasePart].Touched:Connect(function(Part)
if Part:FindFirstAncestorOfClass("Model") and game.Players:GetPlayerFromCharacter(Part:FindFirstAncestorOfClass("Model")) then
local WhiteListed
for i, v in next, game.Players:GetChildren() do
if v.Name == game.Players:GetPlayerFromCharacter(Part:FindFirstAncestorOfClass("Model")).Name then
WhiteListed = true
end
end
if not WhiteListed then
game.Players:GetPlayerFromCharacter(Part:FindFirstAncestorOfClass("Model")).Humanoid.Health = 0
else
return
end
end
end)
local part = script.Parent
local whitelist = {
"Expistic", --Names in list format go here
}
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
for i,v in pairs(whitelist) do
if v ~= hit.Parent.Name then
hit.Parent.Humanoid.Health = 0
end
end
end
end)