Is there a different / faster / cleaner way to write this line of code?

I want to make this line of code better looking or just a better way in general of doing this.

if Value.ClassName == "Accessory" and Value.Name ~= "One" and Value.Name ~= "Two" and Value.Name ~= "Three" then
-- code 

Its a checker to see if a player is wearing hats and if the hat names aren’t the specified names then delete the hat.

The and statements just don’t sit right with me

local forbiddenNames = {

if value:IsA("Accessory") and not table.find(forbiddenNames, value.Name) then
1 Like

Perfect thank you :troll::troll:____________________


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.