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

How would I make a store save items that were bought with in-game currency?

Asked by 4 years ago

I have a store that I want to let people use their in-game currency to buy one-time purchase items instead of them having to use their robux like a gamepass. I am not sure how to call out that they have already bought that item when they join like PlayerHasPass. I only have this so far.

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
    local cash = player.stats.Cash
    if cash.Value >= 1000 then
        cash.Value = cash.Value - 1000
        local glowstick = game.ReplicatedStorage.Glowstick:Clone()
        glowstick.Parent = player.Backpack
    end
end)

Obviously right when they buy it, it'll take the money and clone the glowstick into their backpack, but I want to be able to make it so when they join again, it'll be in their inventory because its supposed to be a one-time purchase.

0
Use datastore. JesseSong 3916 — 4y

Answer this question