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

Best way to save what the player has purchased?

Hello,

So I am making a shop for my game; what would be the best way that once the player buys something with the coins they have, to save it? So that once they buy it, they own it and when the rejoin the server, they will not have to re-purchase. Would I do a value inside of the player and just use datastore?

Thanks

  • Not ask for a request but for guidance.

3 comments

0

Ok, but should I use values?

0

update their leaderstats and save in datastore

1 answer

I'd say the way I would do what you're asking for is always make a StringValue for when they purchase something and put that value inside of the Player where you're doing DataStores to everybody. Then use the DataStore to save the value. Also, then make sure all the strings are placed in one spot and iterate through the values when the Player joins the game and make sure all the objects are placed in one place i.e. Replicated Storage. Then use the :findFirstChild() method on each value with the for loop and/or for i,v in pairs() and use an if statement checking for that value. Anyway, that might be way too much however, that's one way you can do it which is quiet simple. So, yea, good luck!

##I hope I helped in one way or another and if you have any questions please, post a comment below.

~~ KingLoneCat

2 comments

0

That is a good idea. Once they buy it, turn the value to something and check to see if that value = whatever I set it to for if they bought it. - I know that sounds confusing.

0

With that method I sincerely hope you use FilteringEnabled

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