Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me?. My Shop script is not working. My cash wont decrease when i buy an item [closed]

Asked by 5 years ago

My Cash is not decreasing when i buy an item

01game.Players.PlayerAdded:Connect(function(player)
02    local Buy = player.PlayerGui:WaitForChild("Gui").Main.Info.Buy
03    local leaderstats = player:FindFirstChild("leaderstats")
04    local Cash = leaderstats:FindFirstChild("Cash")
05    local price = player.PlayerGui:WaitForChild("Gui").Main.Info.Price
06    local Gui = player.PlayerGui:WaitForChild("Gui").Main.Frame
07    local Purchased1 = Gui.Item1.Purchased
08    local Purchased2 = Gui.Item2.Purchased
09    local Purchased3 = Gui.Item3.Purchased
10 
11 
12    Buy.MouseButton1Click:connect(function()
13        print("Yeet")
14        if Cash.Value >= price.Value then
15        Cash.Value = Cash.Value - price.Value
View all 36 lines...

Closed as Too Broad by User#24403

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?