Hello, i found a working script for my shop gui but i have a slight problem, your bought item doesnt go away if you reset/die.
player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
money = player.leaderstats.Money
price = 0--Price
tool = game.Lighting:findFirstChild("PPSH41")
function buy()
if money.Value >= price then
money.Value = money.Value - price
local a = tool:clone()
a.Parent = player.Backpack
local b = tool:clone()
b.Parent = player.StarterGear
end
end
script.Parent.MouseButton1Down:connect(buy)

1 comment
I suggest learning a bit about the scripts you use and creating your own once you learn what everything means. Everyone starts from somewhere!