So I'm trying to make a trading system and right now I'm working on getting the trade system to able to send a trade request to the player. I added a decline button (aka it deletes the gui) and such. Here's the script: Local script:
local remote = game.ReplicatedStorage.TradingRemotes:WaitForChild("TradeRequest")
end)
local debounce = false
local gui = script.Parent.Parent:WaitForChild("Thingy")
script.Parent.MouseButton1Down:Connect(function()
if debounce == false then
debounce = true
local player2 = gui.Text --other player
local players = game:GetService("Players")
local player1 = players.LocalPlayer
remote:FireServer(player2)
wait(1)
debounce = false
end
end)
Server Script:
local rp = game:GetService("ReplicatedStorage")
local remote = rp.TradingRemotes:WaitForChild("TradeRequest")
remote.OnServerEvent:Connect(function(player1, player2)
local players = game:GetService("Players")
if players:WaitForChild(player2).PlayerGui:FindFirstChild("MoreTrade") then return end
if player2 == player1.Name then return end
local guifolder = game.ServerStorage:WaitForChild("TradeGuis")
local gui = guifolder:WaitForChild("MoreTrade"):Clone()
gui.Parent = players:WaitForChild(player2).PlayerGui
gui.Frame.PlayerName.Text = "Incoming trade request from "..player1.Name
end)
It's supposed to not give the gui if it is in player2's playergui, but when I test, it only does it once, and not again, meaning, I send a trade request to player2, he gets the trade request but declines it, now player1 can't send a trade request to him anymore for some reason. Any help is appreciated.

2 comments
Thanks man I added for it to destroy it when you press the decline button and now it works!
Glad that it helped :)