Code Not Working

Hello I am a new dev making a support a creator system! Sorry if I dont understand much but this is my code to see if the code entered is a valid creator code. I am not understanding why it doesnt work
It always says Invalid Code Instead of Code Entered.

local EnterCodeFrame = game.Players.LocalPlayer.PlayerGui.SupportACreator.EnterCodeFrame
local player = game.Players.LocalPlayer
local Button = script.Parent
local ValidCodes = {"TryhardAJ","Flamingo","BigHorseTanks","Player"}

Button.MouseButton1Click:Connect(function()
	if EnterCodeFrame.EnterCodeBox.Text ==  ValidCodes then
		EnterCodeFrame.EnterCodeBox.Text = "Code Entered!"
	else
		EnterCodeFrame.EnterCodeBox.Text = "Invalid Code!"
	end	
	if EnterCodeFrame.EnterCodeBox.Text == ValidCodes then 
		--5% of earnings players use with the codes
	end
end)

You’re trying to compare a string value and a table which shouldn’t work

You should do a for loop like this

for i,v in pairs(ValidCodes) do
	if EnterCodeFrame.EnterCodeBox.Text == v then
		-- do whatever the code is correct
		break
	end
end
2 Likes