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

When I press the Buy button It wont subtract the price from the Players Cash. Can someone fix this? [closed]

Asked by 5 years ago

This is my Buying Script I have all my variables set up correctly

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        if Cash.Value >= price.Value then
14        Cash.Value = Cash.Value - price.Value
15        print("Yeet")
View all 36 lines...
0
Your question is not anymore descriptive or specific. Read the reason as to why it was closed. "This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question". More information than that is needed https://scriptinghelpers.org/help/how-post-good-questions-answers. User#24403 69 — 5y

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?