【发布时间】:2021-05-15 11:43:41
【问题描述】:
我正在做一个Gui商店,在这个商店里你可以买到工具。如果玩家已经在他的库存中拥有它,我想让它不提供工具。我试图寻找答案,但我找不到答案。
这是脚本:
player = script.Parent.Parent.Parent.Parent.Parent.Parent
money = player.leaderstats.Cash
price = 100
tool = game.Lighting:findFirstChild("Bigger")
function buy()
if money.Value >= price then
money.Value = money.Value - price
local tool1 = tool:clone()
tool1.Parent = player.Backpack
local tool2 = tool:clone()
tool2.Parent = player.StarterGear
end
end
script.Parent.MouseButton1Down:connect(buy) ```
【问题讨论】: