I'm making a simulator that has a shop gui. I can save the leaderboard and the backpack but not the guis. For example, if the player buys an item the buy button would be destroyed. But when the player rejoins, the buy button would still there. Which means that you can buy the item twice. Sorry if you don't understand.
01 | -- the script that is going to fire the remote |
02 |
03 | tool = game.Lighting.Tools.Dominus 1 |
04 | player = game.Players.LocalPlayer |
05 | money = player.leaderstats.Clicks |
06 | price = script.Parent.Cost.Value |
07 | buybutton = game.StarterGui.ShopGui.ShopFrame.Item 1 |
08 |
09 |
10 |
11 | function buy() |
12 | if money.Value > = price then |
13 | money.Value = money.Value - price |
14 | workspace.EventsScript.BuyItem 1 :FireServer() |
15 | wait() |
Instead of saving the GUI itself, store a boolean or check if the player still the item. The buy button should always be there but can be turned invisible if you run some checks.
Let’s say I have a player and he bought a sword, he can no longer buy it again. I can simply turn the Buy button’s Invisibility off until he no longer has the sword.
However if you’re trying to implement this when he rejoins then I’d add some type of Boolean in the Datastore for better practice.