Hi! So I am making a minigame that has titles in a shop and when you buy the title, the buy button will say "Equip" instead of "Buy". How would I save it so that when you join and leave again it will save whether or not you have bought this title or not. I have tried using Bool Value but I haven't gotten it to work. Thanks
How would I use datastore to save titles?
1 answer
To remember for if players leave and come back, use data stores (documentation: https://developer.roblox.com/en-us/articles/Data-store)
A BoolValue does not save across sessions, but could be used to remember that they have bought it during a play session. You would have to create and set this value based on the data stores when they join, and then you could use it. Be sure to only modify it on the server; you can listen to its Changed event on the client to update whether your label's text says "Equip" or "Buy". When they click Buy, use a RemoteFunction or RemoteEvent to ask the server to buy it (double check they have enough money first).
2 comments
Hi Sorry I'm late replying but should use an int value instead of a bool value so when it is bought the value is 1 and if its not bought then the value is 0 and also can you store multiple values in 1 datastore or only 1 per datastore?
It's up to you - a BoolValue is fine if you just need a true/false value, but you might want an IntValue if you can buy multiple levels. You should store as much as you can in a single data store (ie all the player's information - use a table) so that you don't have to make too many requests.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
If you want to learn about data stores, consider checking this: https://www.youtube.com/watch?v=DkYupSBUpes and this: https://www.youtube.com/watch?v=n1UpT2csAzo