plrData[Plr]["Codes"] = {}
Events.EC.OnServerEvent:Connect(function(Plr, Data)
if Data ~= nil or Data ~= "" then
local codeToEnter = string.upper(Data)
for i, v in pairs (plrData[Plr]["Codes"]) do
if v == codeToEnter then
print("FOUND") -- code matched, it is definitely there
end
end
if plrData[Plr]["Codes"][codeToEnter] then
print("code found, unsuccessful")
elseif not plrData[Plr]["Codes"][codeToEnter] then
print("new code, engage benefits")
table.insert(plrData[Plr]["Codes"], codeToEnter)
end
end
end)
"Data" is just what the player has inputted and fired an event with this information, but despite being in the table 100% using my sanity check measure, this script still thinks the code does not exist within the table, does plrData[Plr]["Codes"][codeToEnter] not actually check to see if the code exists?
