How do i fix this error?

I’m trying to make a feedback system with HTTPService. I’m trying to transfer information in between scripts from RemoteEvents. One type of information that I’m trying to transfer is textbox text. Whenever I do textbox.Text, it just gives me the player’s name. So, I’m transferring the textbox. I transferred the textbox and now I’m trying to use the text. The next thing that happens is, there’s an error.

-- FeedbackFrame.TextButton.MouseButton1Click:Connect(function()
	if FeedbackFrame.TextBox.Text ~= "" then
		print(TextBox.Text)
		game.ReplicatedStorage.FeedbackSubmit:FireServer(game.Players.LocalPlayer, TextBox)
		wait(1)
		FeedbackFrame.Visible = not FeedbackFrame.Visible
	end
end)

This is in a local script and next, it sends it to the server.

-- game.ReplicatedStorage.FeedbackSubmit.OnServerEvent:Connect(function(player, textBox)
	local playerName = tostring(player.Name)
	print(textBox.Text)
 	local Output = Mail:SendEmail("*this is blurred out for security reasons*", playerName.." has given some feedback!", playerName.." has given feedback. Please respond as quick as possible. "..tostring(textBox.Text))
	print(Output)
	wait(1)
	print(textBox)
end)

Then, this error comes up

Text is not a valid member of Player “Players.robloxmailtest”

Can someone help?

Um I am not sure on what the issue is but you have put a comment were you wanted some code (“-- game.ReplicatedStorage.FeedbackSubmit.OnServerEvent:Connect(function(player, textBox)”

You don’t need to fire the :FireServer() function with your player as the first argument since that function does that automatically for you. Change :FireServer(game.Players.LocalPlayer, TextBox) to :FireServer(TextBox)

The first script is a local script. The second script is a server script.

I know, but you are passing 2 arguments to :FireServer() so OnServerEvent returns 3 arguments: The player who fired the RemoteEvent which is automatically added by the event, the localplayer argument you passed which is the same instance as the first argument and the textbox. So textBox variable equals to the localplayer argument you passed when you fire the event on the serverscript.

Just remove the game.Players.LocalPlayer argument from :FireServer(game.Players.LocalPlayer, TextBox) in your localscript.

Okay, I did that but now, it prints “TextBox” Instead of the TextBox Text.

You need to send the text to the server because changes on the client do not replicate to the server.