For context, this is a local script that's placed inside of a button. At first, the transaction goes through successfully, but if the player rejoins, the stats get reverted back to what they were.
local play = script.Parent.Parent.Parent.Parent.Parent.Parent -- Workspace
script.Parent.MouseButton1Down:connect(function()
if play.leaderstats.Coins.Value >= 100 then
play.leaderstats.Coins.Value = play.leaderstats.Coins.Value - 100
play.leaderstats.Tokens.Value = play.leaderstats.Tokens.Value + 1
end
end)
