Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you place data persistence on a GUI?

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

1 comment

1

I would recommend Data Stores

1 answer

✓ Accepted answer
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


2 comments

0

Thank you so much! :D This really helped

0

Anytime.

This discussion is preserved as it was. New answers, comments, and votes are closed.