Using .. connector on a table, help me

I’ve got a problem and is that I have a variable AnswerQuery and this variables is given a value/data via table like this. The thing is that it does not let me put it together using the .. and I have no other idea on how to join or add something to the variable already. Here is the script.

for i, Element in ipairs(Children) do 
			if Element:IsA("ImageLabel") then
				if Element.Answer.Text ~= "" then
					if AnswerQuery == "" then
						AnswerQuery = ({ ["name"] = string.sub(Element.Name, 9), ["value"] = Element.Answer.Text, ["inline"] = true })
					elseif AnswerQuery ~= "" then
						AnswerQuery = AnswerQuery..(','..{["name"] = string.sub(Element.Name, 9), ["value"] = Element.Answer.Text, ["inline"] = true })
					end
				else
				warn(Element.Name)
				Submit.Text = "MISSING ANSWER(S)"
				wait(5)
				Submit.Text = "APPLY"
				return
			end
			end
	end

CLIENT SIDE^

Server side

local Discord_Webhook = webHook.new(WebhookId,WebhookToken) 
			Discord_Webhook:post{
				username = Title,
				["embeds"] = {{
			["title"] = "**Applications | By iSt_xrm**",
			["type"] = "rich",
			["color"] = tonumber(0xb51b20),
			["thumbnail"] = {["url"] = IMG},
			["footer"] = {
				["text"] = "System by iSt_xrm",
				["icon_url"] = "https://cdn.discordapp.com/attachments/636740004890017792/636748580639735828/256-256-5fbc60a4335d01cd9c35dcf8fae02410.png"},
			["fields"] = {
				{
					["name"] = "Applicant :person_with_blond_hair:",
					["value"] = "["..player.Name.."](https://roblox.com/users/"..player.UserId.."/profile)",
					["inline"] = true
				},
				{
					["name"] = "Applicant Rank :medal:",
					["value"] = player:GetRoleInGroup(5121069),
					["inline"] = true
				},Answer
				
				
				
			}
		}}		
			}

*Where Answer is the AnswerQuery

2 Likes

I also forgot to mention that if I turn it into a string, the server side wont recognize it and will send me error.

1 Like

The operation you’re trying to do on the client is really confusing, so I’m not entirely sure what your desired outcome is.

If I’m correct, you’re trying to bundle multiple answers together into a larger table. I’ve modified your code a little which should give you the desired outcome.

Client:

local finalAnswers={}
for i, Element in ipairs(Children) do 
	if Element:IsA("ImageLabel") then
		if Element.Answer.Text ~= "" then
			table.insert(finalAnswers,{["name"]=string.sub(Element.Name,9),["value"]=Element.Answer.Text,["inline"]=true})
		else
			warn(Element.Name)
			Submit.Text = "MISSING ANSWER(S)"
			wait(5)
			Submit.Text = "APPLY"
			return
		end
	end
end
-- send finalAnswers to the server instead of AnswerQuery

Server:

local Discord_Webhook = webHook.new(WebhookId,WebhookToken) 
Discord_Webhook:post{
	username = Title,
	["embeds"] = {{
		["title"] = "**Applications | By iSt_xrm**",
		["type"] = "rich",
		["color"] = tonumber(0xb51b20),
		["thumbnail"] = {["url"] = IMG},
		["footer"] = {
			["text"] = "System by iSt_xrm",
			["icon_url"] = "https://cdn.discordapp.com/attachments/636740004890017792/636748580639735828/256-256-5fbc60a4335d01cd9c35dcf8fae02410.png"},
		["fields"] = {
			{
				["name"] = "Applicant :person_with_blond_hair:",
				["value"] = "["..player.Name.."](https://roblox.com/users/"..player.UserId.."/profile)",
				["inline"] = true
			},
			{
				["name"] = "Applicant Rank :medal:",
				["value"] = player:GetRoleInGroup(5121069),
				["inline"] = true
			},unpack(Answer)
		}
	}}		
}
4 Likes