script.Parent.Frame.Purchase.Purchase.MouseButton1Click:Connect(function() if game.Players.LocalPlayer.Stats.ShirtStats.BasicShirt.Value == false then if game.Players.LocalPlayer.Stats.Coins.Value >= 0 then game.Players.LocalPlayer.Stats.Coins.Value = game.Players.LocalPlayer.Stats.Coins.Value + 100 script.Parent.Frame.Purchase.Purchase.Text = "Purchased" end else end end)
API is on, LocalScript in a GUI. When you click the purchase button, it does change the value, until you leave. When you leave, it goes back to the previous value.