I already have the data persistence for points, but I don't know how to use data persistence yet. I am trying to make a GUI shop wherein when you buy something, it saves.
I am a beginner scripter, so any help is greatly appreciated :D
game.Players.PlayerAdded:connect(function(player) local itemBought = Instance.new("IntValue",player) itemBought.Value = false itemBought.Name = "ItemBought" player:WaitForDataReady() player.ItemBought.Value = player:LoadNumber("ItemBought",player.ItemBought.Value)--Loads 'ItemBought's' Value end game.Players.PlayerRemoving:connect(function(player) player:WaitForDataReady() player:SaveNumber("ItemBought",player.ItemBought.Value) -- Saves 'ItemBought's' Value end