Script not setting a tostring(index) into a (value) of a different table?
Asked by
6 years ago Edited 6 years ago
I have no idea why it won't do it.
01 | getCommands = function () |
06 | local toChar = CVExtra.toCharList |
07 | local toString = CVExtra.charlistToString |
08 | local function searchTable(tab,nam) |
10 | for i,v in pairs (tab) do |
11 | if tab = = nil or nam = = nil or tostring (tab) = = CVExtra then |
14 | local nam 2 = toChar(nam) |
20 | if typeof(v) = = "function" then |
22 | local funcr = "" .. tostring (i) |
23 | local func = toChar(funcr) |
24 | funcr = toString(func) |
29 | func = parent.. "." ..funcr |
31 | table.insert(functions,func) |
32 | elseif typeof(v) = = "table" then |
34 | searchTable(v, tostring (i)) |
39 | result = searchTable(CVExtra) |
Since concatenation wasn't working, I used one of my scripts that changes the individual letters of a string (toChar) to a table of individual letters. Then has it converted back into a string with toString (custom function)
I've done numerous prints to test and figure out where it goes wrong, but I think it's Roblox. Because somehow even though I set the value of another table to a string, turn it into a table then back into a string and concatenate it, it still puts it as an index for another table, a dictionary.
Of course, the only other alternate solution I could think of is to get the names of the things I want printed, into a table for the script to print, but I want it to get the "commands" I have from my module I am making.
(Edit)
For anyone wondering, "CVExtra" is a table with functions and other tables in it.