Dr_Doge
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 645 |
|
|
| 17 May 2016 06:49 PM |
-- Code:
local hs = game:GetService("HttpService") local Dictionary=hs:JSONDecode(hs:GetAsync("https://raw.githubusercontent.com/adambom/dictionary/master/dictionary.json", true))
local c = Dictionary for i = 1, #c do print(c[i]) end warn'for loop done'
table.foreach(Dictionary,print) warn'table.foreach done'
-- Note that the "Dictionary" table's JSON file is HUGE. Like Huger than Donald Trump. -- Is that why it doest work? -- Because the script is related to Donald Drumph?
|
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
| |
|
ArrowAvro
|
  |
| Joined: 11 May 2016 |
| Total Posts: 20 |
|
| |
|
|
| 17 May 2016 07:00 PM |
| If I'm correct, you can't refer to something in a dictionary with an integer by doing "dictionary[1]". |
|
|
| Report Abuse |
|
|
Dr_Doge
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 645 |
|
|
| 17 May 2016 07:02 PM |
output:
--------------------------------------------------------------------------------- > local hs = game:GetService("HttpService") local Dictonary=hs:JSONDecode(hs:GetAsync("https://raw.githubusercontent.com/adambom/dictionary/master/dictionary.json", true)) local c = Dictonary for i = 1, #c do print(c[i]) end warn'done'
16:43:07.956 - done
---------------------------------------------------------------------------------
> local hs = game:GetService("HttpService") local Dictonary=hs:JSONDecode(hs:GetAsync("https://raw.githubusercontent.com/adambom/dictionary/master/dictionary.json", true)) table.foreach(Dictonary,print) warn'done'
16:43:07.956 - LITHOPHYTIC Of or pertaining to lithophytes. ELAN Ardor inspired by passion or enthusiasm. MISCUE A false stroke with a billiard cue, the cue slipping from theball struck without impelling it as desired. CONDYLOID Shaped like or pertaining to a condyle. ATTEMPERATE Tempered; proportioned; properly adapted.Hope must be . . . attemperate to the promise. Hammond. ADVANTAGE To give an advantage to; to further; to promote; to benefit; toprofit.The ETC (TOO LONG TO PUT EVERYTHING) 16:43:07.956 - done ---------------------------------------------------------------------------------
|
|
|
| Report Abuse |
|
|
|
| 17 May 2016 07:06 PM |
ex: local not_a_dictionary = {1,2,3,4} local dictionary = {me = 1, you = 2, us = 3, them = 4} table.foreachi(dictionary, print) -- this won't print table.foreachi(not_a_dictionary, print) -- this will print
so for it to work it would have to be |
|
|
| Report Abuse |
|
|
Dr_Doge
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 645 |
|
|
| 17 May 2016 07:11 PM |
@fish wait wut... table.foreach is the one that DOES work. The for loop dose not however. Looking back, I realise I could have just put Dictionary for c...
|
|
|
| Report Abuse |
|
|
12103net
|
  |
| Joined: 08 Jul 2013 |
| Total Posts: 350 |
|
|
| 17 May 2016 07:18 PM |
for i,v in pairs(dictionary) do
end
or
print(unpack(dictionary)) |
|
|
| Report Abuse |
|
|