How do I compare multiple strings?

I want to know how to compare multiple strings. I tried using an array but it didn’t work.

if player.Team == {"Team1","Team2","Team3"} then
    --Code
end

It didn’t return any errors.

You’ll have to compare item by item of the table inside a for loop.

if table.find({"Team1", "Team2", "Team3"}, player.Team.Name) then
    --Code
end

I guess this would work

2 Likes