You can write your topic however you want, but you need to answer these questions:
-
Im trying to get the definition of a word and seperating each definition
-
The issue is theres a error “invalid argument #1 to ‘next’ (table expected, got string)”
-
I looked in the developer hub and looked on youtube
function getDefinition(word)
local url = "https://api.dictionaryapi.dev/api/v2/entries/en/"..word
local Async = HttpService:GetAsync(url)
local data = HttpService:JSONDecode(Async) -- Getting the code and turn it into roblox form
for i, things in pairs(data) do
local meanings = things.meanings
for i, num in pairs(meanings) do
for i,nums in pairs(num) do
local definitions = nums.definitions
local lastdefinitions = 0
for i, v in next, nums do
lastdefinitions += 1
end
wait()
local MinNum = 0
local MaxNum = lastdefinitions
for r = MinNum + 1, MaxNum - 1 do
print(r)
-- game.ReplicatedStorage.GetDefinition:FireClient(r,nums[r].definition)
end
end
end
end
end