Greetings all. As you can see this script makes people purchase food using ingame money. The thing is, I now want it to use other tools to purchase, meaning for example they would need a “Yeast”, and “Flour” tool in their inventory in order for the “Bread” item to enter their backpack. How should I go about doing this?
gps = game:GetService("GamePassService")
player = script.Parent.Parent.Parent.Parent.Parent
Wallet = player.beaderbats.Credit
price = 250
tool = game.ReplicatedStorage:findFirstChild("Bread")
function buy()
if Wallet.Value >= price then
Wallet.Value = Wallet.Value - price
local a = tool:clone()
a.Parent = player.Backpack
end
end
script.Parent.MouseButton1Down:connect(buy)