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.

1 comment

0

Use datastore.