local v="\083\104\111\112\082\101\103\105\111\110"local S=1 local f=0 function hookupRegionPart(v)v.Touched:Connect(function(v)if os.clock()<f+S then return end local H=Players.LocalPlayer.Character if H and H:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")==v then MerchBooth.openMerchBooth()end end)v.TouchEnded:Connect(function(v)local S=Players.LocalPlayer.Character if S and S:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")==v then f=os.clock()MerchBooth.closeMerchBooth()end end)end for v,S in ipairs(CollectionService:GetTagged(v))do hookupRegionPart(S)end;(CollectionService:GetInstanceAddedSignal(v)):connect(hookupRegionPart)

local TAG_NAME = "ShopRegion"
local DEBOUNCE_TIME = 1
local lastClose = 0
function hookupRegionPart(regionPart)
	regionPart.Touched:Connect(function(otherPart)
		
		-- Debounce the shop from opening too soon after being closed
		if os.clock() < lastClose + DEBOUNCE_TIME then
			return
		end
		
		local character = Players.LocalPlayer.Character
		if character and character:FindFirstChild("HumanoidRootPart") == otherPart then
			MerchBooth.openMerchBooth()
		end
	end)

	regionPart.TouchEnded:Connect(function(otherPart)
		local character = Players.LocalPlayer.Character
		if character and character:FindFirstChild("HumanoidRootPart") == otherPart then
			lastClose = os.clock()
			MerchBooth.closeMerchBooth()
		end
	end)
end

for _, regionPart in ipairs(CollectionService:GetTagged(TAG_NAME)) do
	hookupRegionPart(regionPart)
end
CollectionService:GetInstanceAddedSignal(TAG_NAME):connect(hookupRegionPart)
