Im trying to make a ModCall but i keep getting the error, also (Discord webhook)
Errors:
13:53:58.016 Argument 2 missing or nil - Server - WebHooks:13
13:53:58.018 Stack Begin - Studio
13:53:58.019 Script ‘ServerScriptService.WebHooks’, Line 13 - Studio - WebHooks:13
13:53:58.019 Stack End
local http = game:GetService("HttpService")
local ratelimit=false
game.ReplicatedStorage.modCall.OnServerEvent:Connect(function(player,reason)
local success,err = pcall(function()
local data = http:JSONEncode({["username"] = player.UserId,["avatar_url"] = require(game.ReplicatedStorage.getAvatar)(player.UserId,Enum.ThumbnailType.HeadShot),["content"] = player.Name..": "..reason.." "..game.PlaceId..":"..game.JobId})
end)
if not success then warn("An error occured while sending message:"..err) return end
if ratelimit then repeat wait(.1) until not ratelimit end
ratelimit=true
delay(30,function()
ratelimit=false
end)
http:PostAsync("Webhook URL",data) -- The line that has error
end)
Does anyone know what is wrong with my script?