Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Application With Trello API Won't Work? Why Not?

Asked by 4 years ago

I couldn't figure out what was wrong with the scripts I and GUI I just spent around 3 hours on, so I came here to see if you guys knew! I'll check the answers in the morning, so sorry if I can't reply.

Local Script:

script.Parent.Activated:Connect(function()
    script.Parent.Text = "Sending Information..."
    local Q1 = script.Parent.Parent.Q1.Text
    local Q1A = script.Parent.Parent["Q1 Answer"].Text
    local Q2 = script.Parent.Parent.Q2.Text
    local Q2A = script.Parent.Parent["Q2 Answer"].Text
    local Q3 = script.Parent.Parent.Q3.Text
    local Q3A = script.Parent.Parent["Q3 Answer"].Text
    local Event = game.ReplicatedStorage.TrelloSend
    local Player = game.Players.LocalPlayer.Name
    Event:FireServer(Player.Name,Q1,Q1A,Q2,Q2A,Q3,Q3A)
end)

Server Script:

local Event = game.ReplicatedStorage.TrelloSend
local API = require(game.ServerScriptService:WaitForChild("TrelloAPI"))
local BoardId = API:GetBoardID("Applications")
Event.OnServerEvent:Connect(function(Plr,Q1,Q1A,Q2,Q2A,Q3,Q3A)
    local LR = API:GetListID("LR Application",BoardId)
    API:AddCard("Application",Plr..": "..Q1.." "..Q1A.." "..Q2.." "..Q2A.." "..Q3.." "..Q3A,LR)
end)

Output: 22:08:56.087 - ServerScriptService.Proccesser:6: attempt to concatenate local 'Q1' (a nil value)

Thanks for reading, and possibly answering.

0
By the way, the error was for line 6 of the server script. FrostedFlakes67 71 — 4y
0
For some reason, Q1 is nil, which is why you can't concat it (using ..). Check all args/answers for nil values and, if found, replace with a blank string before you concat. whenallthepigsfly 541 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

You're providing the wrong arguments to your :FireServer() the first argument you pass is the player name, which in your case is game.Players.LocalPlayer.Name.Name, that's nothing and should've errored. You should remove that argument since the player in your server script is automatically passed by roblox internally to the OnServerEvent.

Ad

Answer this question