Checking for strings in tables

I want it to check if the string exists in a table and then update the text accordingly instead of me having to do if not equal to this or this then that

But this does not work and if someone could tell me what’s the simplest way to do this will be appreciated

local specials = {
	"Master of Cards", "Master of Games"
}

		if newItemFrame.ItemName.Text ~= specials then
			newItemFrame.ItemName.Text = randomItemChosen.Name
		else
			newItemFrame.ItemName.Text = "???"
		end

Check if the entry is absent using table.find (eg. if not table.find(specials, newItemFrame.ItemName.Text)

1 Like

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