I would like to know how can a script find if a value exists in a Lua table, something like
1 | luatable = { "abc" , "cba" , "bab" } |
2 | --example: wanted to know if something in workspace with a name of any of those values exists.. |
How can I do it?
You Could Use A For Loop To Search Through The Descendants Of Workspace Or Whatever Your Looking For
Example
1 | local Table = { "abc" , "bca" , "cab" } |
2 |
3 | for i,v in pairs (workspace:GetDescendants()) do -- Will Go Through Everything in the workspace |
4 | if Table [ v.Name ] then -- If the name of the object is in the table |
5 | -- Do Rest |
6 | end |
7 | end |