Attempt to concatenate string with Instance

I keep getting the error “tried to concentate instance with string” and I have no idea why. I’m just trying to make it so if a person sends a report in it gets sent to my webhook. Heres my GUI script:

local reportedRecently = false

local Players = game:GetService(“Players”)
local client = Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
local reportreason = script.Parent.Parent.reportreason
local plrtoreport = script.Parent.Parent.reportname
local plr = game.Players.LocalPlayer

if reportreason.Text ~= "" and plrtoreport.Text ~= "" and  reportedRecently == false then
	game.ReplicatedStorage.Moderation.reportUser:FireServer(client, plrtoreport, reportreason)
	reportedRecently = true
	script.Parent.Text = "Reported!"
end

end)

after that it sends to event that sends to a script that sends to webhook:

game.ReplicatedStorage.Moderation.reportUser.OnServerEvent:Connect(function(client, plrtoreport, reportreason)
local http = game:GetService("HttpService")
local Data = {
	["content"] = client.Name.. " has reported " ..plrtoreport.. " for " ..reportreason
}

Data = http:JSONEncode(Data)

http:PostAsync("", Data) 

end)

but I have no idea why it’s not working

The firing client is automatically passed as the first argument, so you don’t need it. Remove client from this call.

2 Likes

If it is a TextBox use TextBox | Roblox Creator Documentation when you send them to the remote event also no need to send the player with RemoteEvent | Roblox Creator Documentation because the first parameter of RemoteEvent | Roblox Creator Documentation is the player that fired the remote event as @nicemike40 said.

I also recommend hiding your webhook URL from here because people could send unauthorized requests to your webhook.

1 Like

dude i thank you SO MUCH i love you

1 Like