Issues with grabbing user's TextBox input

third time’s the charm, sob

I am currently working on a side project in the form of something which I believe could be a fun and original game idea good for short gameplay. One of the main mechanics of this game would be sending an embed to a DC server through a webhook whenever a new “submission” is sent.

The webhook is working almost perfectly, however, it seems the game can’t manage to grab the player’s input from a TextBox I need information from.

...

RE.OnServerEvent:Connect(function(plr, textBox)
	local textInput = textBox.Text
	local data = {
		['embeds'] = {{
			['title'] = textInput,
			['description'] = "A new submission has been made: **"..textInput.."**",
			['color'] = tonumber(0xF57D34)
			}
		}
	}
	local finalData = http:JSONEncode(data)
	http:PostAsync(hook,finalData)
	textBox.Text = ""
end)

image

Hopefully, I’ll finally be met with inner peace after I find out the cause of this bug. :pray:

Any ideas?

1 Like

send textBox.Text from the client and not the textBox itself

Could you explain what you mean? I have little experience in coding. :frowning:

from the localscript when firing the remotevent do RemoteEvent:FireServer(TextBox.Text),
and on the server replace your script with this

RE.OnServerEvent:Connect(function(plr, text)
	local data = {
		['embeds'] = {{
			['title'] = text,
			['description'] = "A new submission has been made: **"..text.."**",
			['color'] = tonumber(0xF57D34)
			}
		}
	}
	local finalData = http:JSONEncode(data)
	http:PostAsync(hook,finalData)
end)
1 Like

Thank you so much!
image

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.