local m=game.Players.LocalPlayer local n=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local w=game:GetService("\071\117\105\083\101\114\118\105\099\101")function close()m.PlayerGui.GUIClick:Play()game.ReplicatedStorage.Interactions.Server.UpdateTradeSession:FireServer(4)script.Parent.Parent.EndSession:Fire(true)w.SelectedObject=nil end script.Parent.MouseButton1Click:connect(close)n.InputBegan:connect(function(m)if m.KeyCode==Enum.KeyCode.ButtonB and script.Parent.Parent.Visible then close()end end)


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)
