So I started making a new webhook system by combining all of your answers, But there is a problem, it posts with the player's name, however, the text feedback here is displayed, here is the script.
01 | local url = "oh my god no peekers" |
02 | local http = game:GetService( "HttpService" ) |
03 |
04 | game:GetService( "ReplicatedStorage" ).FeedBack.OnServerEvent:Connect( function (player) |
05 | local info = { |
06 | [ "username" ] = player.Name, |
07 | [ "content" ] = game.StarterGui.FeedbackGui.FeedbackFrame.FeedbackHere.Text |
08 | } |
09 | local newdata = http:JSONEncode(info) |
10 | http:PostAsync(url,newdata) |
11 | end ) |
Your best bet is to use a remote event and have the webhook on the server as an exploiter could easily grab the webook and spam it if it was stored locally. Here's an example
Client script:
1 | script.Parent.MouseButton 1 Click:Connect( function () |
2 | local data = { |
3 | [ "username" ] = "FeedbackBot" ; -- Name you want the webhook to have. |
4 | [ "content" ] = game:GetService( "Players" ).LocalPlayer.Name.. " has said " ..script.Parent.Parent.FeedbackHere.Text; -- Text |
5 | } |
6 |
7 | game:GetService( "ReplicatedStorage" ).FeedBack:FireServer(game:GetService( "HttpService" ):JSONEncode(data)); -- Send the data to the server. |
8 | end ); |
Server script:
1 | local url = "webhook" ; |
2 | game:GetService( "ReplicatedStorage" ).FeedBack.OnServerEvent:Connect( function (Player, info) |
3 | game:GetService( "HttpService" ):PostAsync(url, info); |
4 | end ); |