I am working on a game that requires to be synced with trello boards, so I am using the Trello API by nstrike159, which is a module script. And one of the functions in it is:
function T:AddCard(...)
local url
local args={...}
local dat=nil
if #args==3 then
local nam,des,lid=args[1],args[2],args[3]
dat={
name=nam,
desc=des.."",
idList=lid,
urlSource=nil,
due=nil
}
--here,, I sent 3 arguments, and the table is supposed to contain them, but for some reason (scroll down until you see more notes on line 71 and 73) it is not recieving arguments.
elseif #args==4 then
local nam,des,lid,url=args[1],args[2],args[3],args[4]
dat={
name=nam,
desc=""..des,
idList=lid,
urlSource=url,
due=nil
}
elseif #args==5 then
local nam,des,lid,url,po=args[1],args[2],args[3],args[4],args[5]
dat={
name=nam,
desc=""..des,
idList=lid,
urlSource=url,
pos=po,
due=nil
}
elseif #args==6 then
local nam,des,lid,url,po,de=args[1],args[2],args[3],args[4],args[5],args[6]
dat={
name=nam,
desc=""..des,
idList=lid,
urlSource=url,
pos=po,
due=de
}
elseif #args==7 then
local nam,des,lid,url,po,de,label=args[1],args[2],args[3],args[4],args[5],args[6],args[7]
dat={
name=nam,
desc=""..des,
idList=lid,
urlSource=url,
pos=po,
due=de,
labels=label
}
elseif #args==8 then
local nam,des,lid,url,po,de,label,cc=args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]
dat={
name=nam,
desc=""..des,
idList=lid,
urlSource=url,
pos=po,
due=de,
labels=label,
idCardSource=cc
}
end
local data
if dat~= nil then
data=HS:JSONEncode(dat) --this is not ran
else
error("No Parameters Found!") --this is ran
return false
end
if Private then
getAddon()
url="https://api.trello.com/1/cards"..addon
else
getAddon()
url="https://api.trello.com/1/cards"..addon
end
local re=HS:PostAsync(url,data)
return HS:JSONDecode(re)
end
to call the function I use
wait(5)
local Trello = require(script.Parent)
print("TrelloAPI ready")
Trello.AddCard("0.0.0.0","Test","8yeLFTbN")

2 comments
btw, the TrelloAPI is over 1000 lines long, that is just one of the many functions
Thats not a good way to implement this, you duplicate everything.