Feedback Submission Gui Not Working

I’m trying to make a submit feedback gui for my game that would allow players to report bugs or give suggestions for the game. The feedback would be sent to a discord webhook so I could see it. (I am confident that this will be fine because not many people play my game so I shouldn’t get too many submissions and of course if I do I could just shut it off)

The problem is, it doesn’t work. I have a gui with a text box and a button to submit. When you click the button it will take the text in the box from the client and invoke a RemoteFunction that is then handled on the server. When I try to submit feedback, it gives me the following error:

attempt to concatenate string with Instance

Any ideas? (The code is below)

Client side code
script.Parent.MouseButton1Click:Connect(function()

script.Parent.Parent.Visible = false

script.Parent.Parent.Parent.ActivationButton.Visible = true

game.ReplicatedStorage.SubmitFeedback:InvokeServer(script.Parent.Parent.Parent.Parent.Parent, script.Parent.Parent.TextBox.Text)

end)
Server side code
game.ReplicatedStorage.SubmitFeedback.OnServerInvoke = function(player, feedback)
	local success, errorMessage = pcall(function()
		local Data = {
			["content"] = player.Name.. " submitted feedback in the roblox movie theater. Here's what they have to say: ".. feedback
		}
		Data = http:JSONEncode(Data)
		http:PostAsync("(You don't have to see my api key thanks >:C)", Data)	
	end)
	if success then
		return true
	end
	if not success then
		warn("Something went wrong. Error message: ".. errorMessage)
		return false
	end
end

This is because in your remote event, the first argument you send over is an Instance, not text. You just do “script.Parent.Parent…” I’m not 100% sure what this instance is, however. The second argument you sent is indeed text, so it could be concatenated with the text, but in your server script, you don’t make a place for that second argument in three .OnServerInvoke. Remember that the first parameter of .OnServerInvoke will always be “player,” so if the “script.Parent.Parent” thing is your way of finding the player instance, note that it is unnecessary.

So basically, either add “.Text” to the end of your first argument in the local script (if it is a text object), or remove that argument entirely if it is the player.

1 Like