I am creating a Feedback GUI in my game that allows users to report bug, exploiters and general feedback. I want it so when you type in your feedback, a event is fired that the server picks up and sends a HTTP request to my Discord webhook. I don't know why but when the variable ' bug ' is sent over, it prints as my username.
Client side -
local url = "My url"
local http = game:GetService("HttpService")
local feedbackGUI = script.Parent.Parent.Parent.Feedback
local submitButton = feedbackGUI.submit.TextButton
local textBox = feedbackGUI.wrtitingBox
local optionsGUI = script.Parent.Parent
local webhook = game.ReplicatedStorage.Feedback
--Buttons
local bugButton = script.Parent.Bug
local feedbackButton = script.Parent.Feedback
local hackerButton = script.Parent.Hacker
bugButton.MouseButton1Click:Connect(function()
optionsGUI:TweenPosition(UDim2.new(20, 0,6.64, 0), Enum.EasingDirection.In,Enum.EasingStyle.Bounce,1.5,true)
wait(1)
feedbackGUI.hotbar.TextLabel.Text = "Zoo Tycoon : Bug"
feedbackGUI.wrtitingBox.PlaceholderText = "Type your bug here!"
feedbackGUI:TweenPosition(UDim2.new(1.119, 0,6.626, 0), Enum.EasingDirection.Out,Enum.EasingStyle.Bounce,1.5,true)
submitButton.MouseButton1Click:Connect(function()
local bug = textBox.Text
feedbackGUI:TweenPosition(UDim2.new(20, 0,6.64, 0), Enum.EasingDirection.In,Enum.EasingStyle.Bounce,1.5,true)
webhook:FireServer(bug)
end)
end)
Server Side
local url = "My url"
local http = game:GetService("HttpService")
game.ReplicatedStorage.Feedback.OnServerEvent:Connect(function(theBug)
print(theBug)
local HookData = {
['username'] = "feedback",
['content'] = theBug
}
HookData = http:JSONEncode(HookData)
http:PostAsync(url, HookData)
end)

1 comment
Firstly remove ur webhook's link, don't leak it!