-- goro7


local plr = game.Players.LocalPlayer
local inputService = game:GetService("UserInputService")
local guiService = game:GetService("GuiService")

function close()
	
	-- Set not visible
	plr.PlayerGui.GUIClick:Play()
	game.ReplicatedStorage.Interactions.Server.UpdateTradeSession:FireServer(4)
	script.Parent.Parent.EndSession:Fire(true)
	guiService.SelectedObject = nil
	
end

script.Parent.MouseButton1Click:connect(close)
inputService.InputBegan:connect(function(inputObj)
	if inputObj.KeyCode == Enum.KeyCode.ButtonB and script.Parent.Parent.Visible then
		close()
	end
end)
