I was creating a Trello and Discord Notifyer when someone buys an item. But when I use the GUI button. It sends a request but the listener doesn't receive it. I don't know why. Below is an Image, scripts and other stuff to help. (Don't mind the Marketplace variable, I didn't get to it yet)
PhotoLink! If it doesn't work: https://gyazo.com/68ca142fe12233e22d4fd4872e532eab
Local Script
script.Parent.Order.MouseButton1Down:Connect(function() script.Parent.Purchaced.Visible = true game.ReplicatedStorage.PurchaseCrates:Fire() print("Sent with the player name of "..plr) script.Parent.Order.Text.Text = "Ordered!" end)
Script in Event
local MPS = game:GetService("MarketplaceService") local APIModule = require(game.ReplicatedStorage.WebhookAPI) local TrelloAPI = require(game.ServerScriptService.TrelloAPI) local boardID = TrelloAPI:GetBoardID("Testing Product Hub") local ListID = TrelloAPI:GetListID("New Orders", boardID) local newWebHook = APIModule.new("489927603705348119","gQfpv9bM2hlTaArDyl54eqfT1kxQXjVW3f6JOCEzqvOzYkCdaMtVU2ouSRDjIuw4oAuh") local Event = script.Parent --Signaling local Players = game:GetService("Players") Players.PlayerAdded:Connect(function(plr) if Event.Event then newWebHook:post{ username = "Purchace Bot", content = "@here **"..plr.."** has purchaced crates." } TrelloAPI:AddCard("Name:"..plr,"Purchacing Crates",ListID) end end
Hope someone figures it out because I am stumped.
LS
script.Parent.Order.MouseButton1Down:Connect(function() script.Parent.Purchaced.Visible = true game.ReplicatedStorage.PurchaseCrates:FireServer() print("Sent with the player name of "..game.Players.LocalPlayer.Name) script.Parent.Order.Text.Text = "Ordered!" end)
S
local MPS = game:GetService("MarketplaceService") local APIModule = require(game.ReplicatedStorage.WebhookAPI) local TrelloAPI = require(game.ServerScriptService.TrelloAPI) local boardID = TrelloAPI:GetBoardID("Testing Product Hub") local ListID = TrelloAPI:GetListID("New Orders", boardID) local newWebHook = APIModule.new("489927603705348119","gQfpv9bM2hlTaArDyl54eqfT1kxQXjVW3f6JOCEzqvOzYkCdaMtVU2ouSRDjIuw4oAuh") local Event = script.Parent --Signaling-- function onPurchaseFired(player) TrelloAPI:AddCard("Name:"..player.Name,"Purchasing Crates",ListID) newWebHook:post{ username = "Purchase Bot", content = "@here **"..player.Name.."** has purchased crates." } end script.Parent.OnServerEvent:Connect(onPurchaseFired) --Signaling--
Not sure if this works or not, but it probably will. Please, spell purchased correctly. That will annoy a few users that want to buy things. Once again, I never tested this. If I made a mistake, let me know and I'll have it fixed tomorrow by this time.
What you did wrong was try checking for a value that most likely will never exist. Firing the server can't be checked for true or false. Also, it only tried checking when a player joined.