Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Finding objects in a table?

How do I create a function that looks through a specified table for a specified string, and returns true if it finds it? Here is my code:

local admins = { "MrFlimsy", "Xavier12321", "NotAshley", "Interactivity" }

function find(table,string)
    --this is the code I need help with
end

game.Players.PlayerAdded:connect(function(plr)
    plr.Chatted:connect(function(msg)
        if find(admins,plr.Name) then
            --stuff here later
        end
    end
end

I want to make it so only players in my 'admins' list can use the chat commands. Any help would be appreciated.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.