Why wont my question GUI not work?

So I am trying to make a question Gui where admins can write a question and everyone on the server answers the question.

However, when I set up the Gui, there is a script that allows you to submit the question. This submit button does not work and I am not sure how to fix it.

I have tried to find a fix but I could not figure it out.

Here is a screenshot of the Gui, and when I press submit it should print the question and answer choices in the output. However, it prints other stuff that I do not want it to.

For example, when I press submit on this it should send the question and answer choices to the server from a remote event.

In the output, it should print the question, answer a, b, c, and d in that order. But this is the output.

Screenshot_23

Script on the submit button:

local db = true
local rs = game:GetService("ReplicatedStorage")

script.Parent.MouseButton1Click:Connect(function()
	if db == true then
		if script.Parent.Parent.QuestionInput.Text ~= "" then
			local Question = script.Parent.Parent.QuestionInput.Text
			local AnswerA = script.Parent.Parent.AnswerA.Text
			local AnswerB = script.Parent.Parent.AnswerB.Text
			local AnswerC = script.Parent.Parent.AnswerC.Text
			local AnswerD = script.Parent.Parent.AnswerD.Text
			rs.Remotes.QuestionR:FireServer(Question, AnswerA, AnswerB, AnswerC, AnswerD)
	elseif script.Parent.Parent.QuestionInput.Text == "" then
		db = false
		script.Parent.Text = "Question is empty!"
		wait(2)
		script.Parent.Text = "Submit"
		db = true
		end
	end
end)

Script with the remote event:

local rs  = game:GetService("ReplicatedStorage")

rs.Remotes.QuestionR.OnServerEvent:Connect(function(Question, AnswerA, AnswerB, AnswerC, AnswerD)
	print(Question)
	print(AnswerA)
	print(AnswerB)
	print(AnswerC)
	print(AnswerD)
end)

If anyone has a fix, please let me know! Thank you.

Can you please show us the explorer and what names the remote events and things have?

It is printing the answers which the submit button does, Try making it close the GUI to see if the button works like make it disable the GUI

Check if the answers are named properly and have the correct text.

@creepersaur

Screenshot_25

@TheLegendOfSirenhead Okay, I will try it!

@sniper74will Yes, everything is named properly and has the correct text as far as I know.

ACTUALLY I HAVE THE ANSWER!

you see, when receiving the output (OnServerEvent) of ANY remote event the first parameter in :Connect(function(“this one”) will ALWAYS be the player that called the event for example:

if I click a button and fire a server event then the server script should be:

RS.Event.OnServerEvent:Connect(function(Player) --Anything that is the first parameter will be the player name!

      Print(Player.name)

end)

when firing the remote event from a client, the first parameter in the :FireServer()

will be the second one on the server

yes, but that doesnt change that it still prints in the wrong order.

Make sure the answers the GUI outputs are correct since the remote event looks correct like make sure the text box that is for B is not where the C textbox is

@HowlingToucan see what I said, the script is correct, but add player before question:

local rs  = game:GetService("ReplicatedStorage")

rs.Remotes.QuestionR.OnServerEvent:Connect(function(Player,Question, AnswerA, AnswerB, AnswerC, AnswerD)
   print(Question)
   print(AnswerA)
   print(AnswerB)
   print(AnswerC)
   print(AnswerD)
end)

Oh okay, I think I have a fix now. Anyways, thank you all so much for the help! I’ll leave another comment if I am having difficulties again.