|
| 07 Dec 2015 12:43 PM |
Hey, I'm making a script that allows users to summit a feedback, which sends it right to a trello board (private). I'm quite new to http in Rbx.Lua, but I still can't figure why it's erroring. Could you guys help me out? I know what I got my token and key right.
Script:
local HS = game:GetService("HttpService")
descb = script.Parent.Text plr = script.Parent.Parent.Parent.Parent --function below function AddCard(Name, List, Desc)
local NewCard = {}
NewCard.Name = plr .. [[**'s Feedback **]] NewCard.desc = descb.Text NewCard.key = KeyHere (This is a private board, so I have to "block" the key) NewCard.token = TokenHere (This is a private board, so I have to "block" the token)
local ACEncode = HS:JSONEncode(NewCard)
HS:PostAsync(List.."/Feedback", ACEncode)
end -- button script below
script.Parent.MouseButton1Down:connect(function() AddCard() end)
After testing it in Studio and a server, I got this error. 13:39:10.914 - Players.Player.PlayerGui.ScreenGui.FeedbackFrame.SummitButton.Script:10: attempt to concatenate global 'plr' (a userdata value) 13:39:10.917 - Stack Begin 13:39:10.919 - Script 'Players.Player.PlayerGui.ScreenGui.FeedbackFrame.SummitButton.Script', Line 10 - global AddCard 13:39:10.920 - Script 'Players.Player.PlayerGui.ScreenGui.FeedbackFrame.SummitButton.Script', Line 24 13:39:10.921 - Stack End |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2015 12:44 PM |
Trello API Help*
I should have spell-check the title :| |
|
|
| Report Abuse |
|
|
Skyman772
|
  |
| Joined: 20 Mar 2012 |
| Total Posts: 9305 |
|
|
| 07 Dec 2015 01:10 PM |
| Change plr's value to game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
Skyman772
|
  |
| Joined: 20 Mar 2012 |
| Total Posts: 9305 |
|
|
| 07 Dec 2015 01:11 PM |
| Also NameCardName seems to be using plr in the string so I'm guessing you're gonna want Plr.Name, since Plr is an Object (userData) value and plr is a String (which would be compatible in a Name string) |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2015 01:34 PM |
| I did change plr to game.Players.LocalPlayer. As for the plr.Name, I'll try it. |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2015 01:38 PM |
| wow, I see my problem. My scripting was correct, but somehow I forgot to make it plr.userId and plr = script.Parent.Parent.Parent.Parent.Parent (it's in a server script :|). Such a noob mistake on my end. |
|
|
| Report Abuse |
|
|