Now, i’m trying to create an Application Center with Trello. (I know, Trello isn’t used for storing data! I’m just using it because it’s simpler for me.)
So what happens is, when you enter a code in a GUI, it fires a remote event into the Server Script. The server script then detects if the code == nil
. Now, if it doesn’t and the code exists on the system, the script will fire another remote to the GUI which clones a question template to match the questions on the Trello Board. The thing is, the template isn’t cloning. Any help?
LOCALSCRIPT - Template Cloning
game.ReplicatedStorage.AppCode.OnClientEvent:Connect(function(questions, status)
local questioncount = 0
if status == 'ok' then
for _,v in pairs(questions) do
local q = script.Parent:WaitForChild("Template"):Clone()
q.Name = 'Question '..questioncount + 1
q.Visible = true
q.PlaceholderText = v.name
end
end
end)
LOCALSCRIPT - Fire RemoteEvent With Application Code
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.AppCode:FireServer(script.Parent.Parent.Enter.Text)
end)
game.ReplicatedStorage.AppCode.OnClientEvent:Connect(function(code, status)
if status == 'error' then
script.Parent.Text = code
wait(2)
script.Parent.Text = 'Send'
else
script.Parent.Parent.Parent.AppScreen.Visible = true
end
end)
SERVERSCRIPT
local Trello = require(script.Parent.TrelloAPI)
local Board = '5ec9fd551c19440ce155a27b'
local Remote = game.ReplicatedStorage.AppCode
Remote.OnServerEvent:Connect(function(plr, code)
local list = Trello:GetListID(code, Board)
local status
if list == nil then
status = 'error'
Remote:FireAllClients('Invalid Key!', status)
else
status = 'ok'
local questions = Trello:GetCardsInList(list)
Remote:FireAllClients(questions, status)
end
end)