Making a Mod Call Script (Problem)

  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.

Can you send the script you fire the event in?

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)

I put it in the “Confirm” button so it can fire the event.

I usually put an extra player argument. Try doing that.

Like this: Event.OnServerEvent(plr, plr, reason) and Event:FireServer(plr, reason)

Alright, let me try this in a bit.

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)