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
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
Thank you so much! :D This really helped
Anytime.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
I would recommend Data Stores