I was just making a award command with webhook but then it gave me a error. (look to the title), My code is below.
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local args = msg:split(" ")
local plruser = args[2]
local user = game.Players:FindFirstChild(plruser)
if args[1] == "-award" and plr:GetRankInGroup(33075577) >= 228 then
if user then
local currentValue = user.leaderstats:FindFirstChild("Exp")
local fields = {
{
['name'] = "Info",
['value'] = "User: " .. plr.Name .. "\nRank: **" .. plr:GetRoleInGroup(33075577) .. "**",
['inline'] = true
},
{
['name'] = "Award Info",
['value'] = "User Awarded " .. user.Name .. "\nAward added: **" .. script.Parent.Variables.Awards.AwardToGive:FindFirstChild("Value") .. "** EXP."
}
}
currentValue.Value += script.Parent.Variables.Awards.AwardToGive.Value
print(" --[ Awards ]-- ")
print(" Gave "..user.Name.. " "..script.Parent.Variables.Awards.AwardToGive.Value)
print(" --[ Awards ]-- ")
user:LoadCharacter()
ws:createEmbed(url, "WARN", "This is published on 30/10/2023 11:08 pm by **RobloxSupp515**", fields)
else
print("Failed to award player, is it a correct user?")
end
end
end)
end)