so this webhook fires when a player redeems a valid code.
here’s the code redeeming script (Local), it works.
and this is where the error is: (server script in sss)
local https = game:GetService("HttpService")
local WebHook = --LINK--
local Event = game.ReplicatedStorage.Reward
local codeReward = 50
Event.OnServerEvent:Connect(function(player, code)
print("Code Worked!")
player.Settingsfolder.credits.Value += codeReward
player.PlayerGui.Menus.Credits.ShopBG.creditsvalue.Text = player.Settingsfolder.credits.Value
local data =
{
["content"] = "",
["embeds"] = {{
["title"] = "Code Redeemed",
["description"] = player.Name .. " Redeemed a Code",
["type"] = "rich",
["color"] = tonumber(0xffffff),
["fields"] = {
{
["name"] = "Code:",
["value"] = code,
["inline"] = false
},
{
["name"] = "Reward",
["value"] = codeReward .. " Credits",
["inline"] = true
}}}}}
local finalData = https:JSONEncode(data)
https:PostAsync(WebHook, finalData)
end)
and finally, here’s the error. does anyone see a problem? thanks.