local h=require(((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\114\098\120\116\115\095\105\110\099\108\117\100\101")):WaitForChild("\082\117\110\116\105\109\101\076\105\098"))local k=(h.import(script,game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101"),"\114\098\120\116\115\095\105\110\099\108\117\100\101","\110\111\100\101\095\109\111\100\117\108\101\115","\064\114\098\120\116\115","\108\111\103","\111\117\116")).default local V=h.import(script,game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101"),"\084\083","\099\111\109\112\111\110\101\110\116\115")local O=V.Body local z=V.NPC local y=V.Wants local function J(h,V)for V,y in h:queryChanged(y)do if not y.old and y.new then k.Info("\118 \087\097\110\116\115 "..(tostring(V)..(" \124 "..(tostring(y.new.product.amount)..("\120 "..y.new.product.product)))))task.delay(1,function()if not h:contains(V)then return nil end local J=h:get(V,z)local G=h:get(V,O)if G~=nil then G=G.model end local M=G if not J or not M then k.Error("\078\111 \078\080\067 \111\114 \066\111\100\121 \099\111\109\112\111\110\101\110\116 \102\111\114 \099\117\115\116\111\109\101\114")return nil end M.DialogGui.DialogFrame.DialogText.Text="\073 \119\097\110\116 "..(tostring(y.new.product.amount)..("\120 "..y.new.product.product))M.DialogGui.Enabled=true end)end if y.old and y.new then k.Info("\120 \087\097\110\116\115 "..(tostring(V)..(" \124 "..(tostring(y.new.product.amount)..("\120 "..y.new.product.product)))))if not h:contains(V)then return nil end local J=h:get(V,z)local G=h:get(V,O)if G~=nil then G=G.model end local M=G if not J or not M then k.Error("\078\111 \078\080\067 \111\114 \066\111\100\121 \099\111\109\112\111\110\101\110\116 \102\111\114 \099\117\115\116\111\109\101\114")continue end M.DialogGui.DialogFrame.DialogText.Text="\073 \119\097\110\116 "..(tostring(y.new.product.amount)..("\120 "..y.new.product.product))M.DialogGui.Enabled=true end if y.old and not y.new then if not h:contains(V)then return nil end local y=h:get(V,z)local J=h:get(V,O)if J~=nil then J=J.model end local G=J if not y or not G then k.Error("\078\111 \078\080\067 \111\114 \066\111\100\121 \099\111\109\112\111\110\101\110\116 \102\111\114 \099\117\115\116\111\109\101\114")continue end G.DialogGui.DialogFrame.DialogText.Text="\084\104\097\110\107\115\033"task.wait(2)G.DialogGui.Enabled=false end end end return J
-- Compiled with roblox-ts v2.1.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Log = TS.import(
	script,
	game:GetService("ReplicatedStorage"),
	"rbxts_include",
	"node_modules",
	"@rbxts",
	"log",
	"out"
).default
local _components = TS.import(script, game:GetService("ReplicatedStorage"), "TS", "components")
local Body = _components.Body
local NPC = _components.NPC
local Wants = _components.Wants
local function customer(world, _)
	for id, wants in world:queryChanged(Wants) do
		if not wants.old and wants.new then
			Log.Info(
				"v Wants "
					.. (
						tostring(id)
						.. (" | " .. (tostring(wants.new.product.amount) .. ("x " .. wants.new.product.product)))
					)
			)
			task.delay(1, function()
				if not world:contains(id) then
					return nil
				end
				local npc = world:get(id, NPC)
				local _result = world:get(id, Body)
				if _result ~= nil then
					_result = _result.model
				end
				local body = _result
				if not npc or not body then
					Log.Error("No NPC or Body component for customer")
					return nil
				end
				body.DialogGui.DialogFrame.DialogText.Text = "I want "
					.. (tostring(wants.new.product.amount) .. ("x " .. wants.new.product.product))
				body.DialogGui.Enabled = true
			end)
		end
		if wants.old and wants.new then
			Log.Info(
				"x Wants "
					.. (
						tostring(id)
						.. (" | " .. (tostring(wants.new.product.amount) .. ("x " .. wants.new.product.product)))
					)
			)
			if not world:contains(id) then
				return nil
			end
			local npc = world:get(id, NPC)
			local _result = world:get(id, Body)
			if _result ~= nil then
				_result = _result.model
			end
			local body = _result
			if not npc or not body then
				Log.Error("No NPC or Body component for customer")
				continue
			end
			body.DialogGui.DialogFrame.DialogText.Text = "I want "
				.. (tostring(wants.new.product.amount) .. ("x " .. wants.new.product.product))
			body.DialogGui.Enabled = true
		end
		if wants.old and not wants.new then
			if not world:contains(id) then
				return nil
			end
			local npc = world:get(id, NPC)
			local _result = world:get(id, Body)
			if _result ~= nil then
				_result = _result.model
			end
			local body = _result
			if not npc or not body then
				Log.Error("No NPC or Body component for customer")
				continue
			end
			body.DialogGui.DialogFrame.DialogText.Text = "Thanks!"
			task.wait(2)
			body.DialogGui.Enabled = false
		end
	end
end
return customer
