I am trying to make a one-time purchase script for in-game currency. I figured out how to make the item the player bought save for when they rejoin but I couldn't figure out how to make the purchase button go away forever. I've made it disappear for when they are in the game but when they rejoin it will obviously be visible again.
local player = game.Players.LocalPlayer
local re = game.ReplicatedStorage.Glowstick
script.Parent.MouseButton1Click:Connect(function()
if player.stats.Cash.Value >= 1000 then
re:FireServer()
wait(0.1)
script.Parent.Visible = false
elseif player.stats.Cash.Value < 1000 then
script.Parent.Parent.Parent.Parent.InvalidAmount.Visible = true
wait(2)
script.Parent.Parent.Parent.Parent.InvalidAmount.Visible = false
end
end)

1 comment
That does work but how would I make the purchase button go away forever even when they rejoin again?