I don't know what is wrong with It, it seems fine.
local player = script.Parent.Parent.Parent.Parent.Parent
local stats = player.leaderstats.Cash
local Cost = 20
local Item = game.ReplicatedStorage.Purchase.OBJECTNAMEHERE:Clone()
function click()
if player.Backpack:FindFirstChild(Item) then
return
else
if stats.Value<=Cost then
Item.Parent=player.Backpack
else
script.Parent.Parent.AreYouSure.Text="You don't have enough money!"
wait(2)
script.Parent.Parent.AreYouSure.Text=script.Parent.Parent.AreYouSure.Texta.Value
end
end
end
script.Parent.MouseButton1Click:connect(click)
