--[[
To make another trader, duplicate a trader and change the proximity prompt text in their UpperTorso
ActionText: "FinalItemName"
ObjectText = "ItemRequired: 0/AmountRequired"
]]

events.TradeItem.OnServerEvent:Connect(function(plr, PP, final)
	local tool = plr.Character:FindFirstChildWhichIsA("Tool")
	tool:Destroy()
	if final then
		tools[PP.ActionText]:Clone().Parent = plr.Backpack
	end
end)

NPCs.Seller.UpperTorso.ProximityPrompt.Triggered:Connect(function(plr)
	local char = plr.Character
	if not char then return end
	local tool = char:FindFirstChildWhichIsA("Tool")
	if not tool or not tool:FindFirstChild("Handle") then return end
	local res = tool.Handle:FindFirstChild("Price")
	if res then
		tool:Destroy()
		plr.Wallet.Value += res.Value
	end
end)
