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

It Dosnt remove 200 money from the leaderstat?!?!?!?!?!?!

Asked by 8 years ago

When you click Buy Plane it dosnt remove 200 money from the leaderstat Heres the code. theres more code thats just the part that not working

if game.Players.LocalPlayer.leaderstats.Money.Value >= 200 then

            ----------What The Player Does when you buy it


            game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Money.Value - 200

            game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.ImageLabel.Visible = true
            game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.SpawnPlane.Visible = true



        end

This is the hole script if you wanna look at that

------------------OPEN

game.Players.LocalPlayer.PlayerGui.ShopGui.TextButton.MouseButton1Click:connect(function()

game.Players.LocalPlayer.PlayerGui.PS.Frame.Visible = true





----------------------WHAT HAPPENDS WHEN YOU BUY IT




if game.Players.LocalPlayer.PlayerGui.PS.Frame.Visible == true then


    game.Players.LocalPlayer.PlayerGui.PS.Frame.BuyPlane1.MouseButton1Click:connect(function()


        if game.Players.LocalPlayer.leaderstats.Money.Value >= 200 then



            ----------What The Player Does when you buy it


            game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Money.Value - 200

            game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.ImageLabel.Visible = true
            game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.SpawnPlane.Visible = true



        end     
    end)        
end




--------------------CLOSE


if game.Players.LocalPlayer.PlayerGui.PS.Frame.Visible == true then


    game.Players.LocalPlayer.PlayerGui.PS.Frame.Close.MouseButton1Click:connect(function()

        game.Players.LocalPlayer.PlayerGui.PS.Frame.Visible = false


    end)
end

end)

0
Does it work to make those GUI's visible? dyler3 1510 — 8y
0
When you click Buy it suppost to make 2 things visible and remove cash space1177 7 — 8y
0
You need some MouseButton1Down events. and better spacing Shawnyg 4330 — 8y

Answer this question