Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I detect if a string is in a table?

Asked by 3 years ago
Edited 3 years ago

Hi, I want to find my string in my table. I want to see if the string is in the table, FindFirstChild is not working.

RemoteEvent.OnServerEvent:Connect(function(Player, Robbery)

    local AvailableRobberies = {"ImpossibleJewelry"}

    if AvailableRobberies:FindFirstChild(Robbery) then

        print("Result")
    end
end)

1 answer

Log in to vote
1
Answered by 3 years ago
if table.find(AvailableRobberies,Robbery) then
0
I should have known this, thanks lol Bankrovers 226 — 3y
Ad

Answer this question