View Single Post
08-04-17, 01:15 PM   #9
Kakjens
A Cliff Giant
Join Date: Apr 2017
Posts: 75
Originally Posted by Mortimerlol View Post
Thanks for reply!

I trying with ur code and cant be good.
Lua Code:
  1. local tableC = {}
  2. for k,v in pairs(BangCharKills) do tableC[#tableC + 1] = k end
  3.     if hates[v] then
  4.         tableC[k] = v
  5.     end
  6. table.sort(tableC)
  7.     --for i = 1, #tableC do print(tableC[i]) end
  8.     print(tableC[1])
  9. end
Thanks for providing input and expected output.
I don't understand how did you derive your code from example of Banknorris.
Why
Code:
tableC[#tableC + 1] = k end
in line 2 is required? Why there's "end" in line 9 instead of being after line 5?
You'll probably want to use your specialized sorting instead of table.sort.
Do you use notepad for writing, or some dedicated script editor (semi-random indentation doesn't help)?
  Reply With Quote