Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cloneTable(original)
- local copy = {}
- for k, v in pairs(original) do
- if type(v) == "table" then
- v = cloneTable(v)
- end
- copy[k] = v
- end
- return copy
- end
- local function findplaceonmap(tabll,location)
- local mp = {}
- local countup = 0
- local function find(tabl,name)
- for i,v in pairs(tabl) do
- countup = countup + 1
- if type(v) == "table" then
- table.insert(mp,{tabl,tabl[i-2]})
- find(v[4],name)
- elseif type(v) == "string" and v == name then
- --print(v)
- table.insert(mp,{tabl,v})
- print(countup)
- return cloneTable(mp)
- end
- if i == #tabl then
- print(mp[#mp][2])
- table.remove(mp,#mp)
- end
- end
- end
- local tab = find(tabll,location)
- local function printTable(tab)
- for i,v in pairs(tab) do
- print(v[1],v[2])
- end
- end
- print(#mp)
- printTable(mp)
- end
- findplaceonmap(map,"climb")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement