Answers for "lua find key in table"

Lua
1

lua find key in table

local MyTable = {hi, hello, sup} -- your table you are refrencing

for key, value in pairs(MyTable) do -- Look for key inside entire table
if key == "hello" then -- Your desired key you want to refrence
-- Run event
end
end
Posted by: Guest on April-25-2022

Browse Popular Code Answers by Language