LMVM2041
(League)
February 3, 2021, 7:18pm
#1
What do you want to achieve? Keep it simple and clear!
I want it so that a GUI will pop up when you click an alert button and a form pops up. This form would have a username textbox and a reason textbox. I want it so that the user can write the violators name down in the username textbox and write the reason in the reason textbox. When the user clicks “Confirm”, the form is sent like an embed to a specific discord channel.
<---------------------------------------------------------------------------------------->
Issue? How can I make the actual script? I already have it set up for the reason textbox but I can’t include the username textbox.
<---------------------------------------------------------------------------------->
HttpsService = game:GetService("HttpService")
URL = "URL HERE BUT CAN'T SHOW"
game.ReplicatedStorage.Report.OnServerEvent:Connect(function(plr,Report)
local Data =
{
["content"] = "New Report | <@&ROLE>",
["embeds"] = {{
["title"] = "__**New Report**__",
["description"] = "Report: "..Report.." ",
["type"] = "rich",
["color"] = tonumber(0xffffff),
["fields"] = {
{
["name"] = "How to join:",
["value"] = "Please use the :join <username> command to join the user that reported!",
["inline"] = true
},
{
["name"] = "Username and User ID:",
["value"] = "Username: "..plr.Name.." and ID: "..plr.UserId.." .",
["inline"] = true
}
}
}}
}
Data = HttpsService:JSONEncode(Data)
HttpsService:PostAsync(URL, Data)
end)
Overall, I just need to see how I can insert the username variable into the same embed.
changeno
(changeno)
February 3, 2021, 7:29pm
#2
Can you send the script you fire the event in?
LMVM2041
(League)
February 3, 2021, 7:31pm
#3
local Player = game.Players.LocalPlayer
local Mouse = script.Parent
local timez = 10
Mouse.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Report:FireServer(script.Parent.Parent.Reason.Text)
game.ReplicatedStorage.Username:FireServer(script.Parent.Parent.Reason.Text)
wait(.1)
script.Disabled = true
wait(timez)
script.Disabled = false
end)
LMVM2041
(League)
February 3, 2021, 7:32pm
#4
I put it in the “Confirm” button so it can fire the event.
changeno
(changeno)
February 3, 2021, 7:35pm
#5
I usually put an extra player argument. Try doing that.
Like this: Event.OnServerEvent(plr, plr, reason) and Event:FireServer(plr, reason)
LMVM2041
(League)
February 3, 2021, 7:36pm
#6
Alright, let me try this in a bit.
LMVM2041
(League)
February 3, 2021, 8:01pm
#7
I changed my code but it’s still glitching:
Main SSS code:
HttpsService = game:GetService("HttpService")
URL = "URL"
game.ReplicatedStorage.Report.OnServerEvent:Connect(function(plr,Username,Report)
local Data =
{
["content"] = "<@LMVM2041>",
["embeds"] = {{
["title"] = "__**New Report**__",
["description"] = "Report: "..Report.." ",
["type"] = "rich",
["color"] = tonumber(0xffffff),
["fields"] = {
{
["name"] = "Violator Information",
["value"] = "Violator name: "..Username.." . Ban/kick if needed.",
["inline"] = true
},
{
["name"] = "Reporter Info",
["value"] = "Username: "..plr.Name.." and ID "..plr.UserId.." ",
["inline"] = true
}
}
}}
}
Data = HttpsService:JSONEncode(Data)
HttpsService:PostAsync(URL, Data)
end)
My other code in the confirm button:
local Player = game.Players.LocalPlayer
local Mouse = script.Parent
local timez = 10
Mouse.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Report:FireServer(script.Parent.Parent.Reason.Text)
game.ReplicatedStorage.Username:FireServer(script.Parent.Parent.Username.Text)
wait(.1)
script.Disabled = true
wait(timez)
script.Disabled = false
end)