generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Data Persistence -> Data Store

Previous Thread :: Next Thread 
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
21 Sep 2016 02:56 PM
Is it possible to change Data Persistence to a Data Store?

The Data Persistence I'm using is:

function onPlayerEntered(player)
wait()-- Change to wait for player longer.
player:WaitForDataReady()
repeat wait() until player:FindFirstChild("leaderstats")
if player.DataReady then
if player:findFirstChild("leaderstats") then
local score = player.leaderstats:GetChildren()
for i = 1,#score do
local ScoreLoaded = player:LoadNumber(score[i].Name)
wait()
if ScoreLoaded ~= 0 then
score[i].Value = ScoreLoaded
end
end
end
end
end

function onPlayerLeaving(player)
if player:findFirstChild("leaderstats") then
local score = player.leaderstats:GetChildren()
for i = 1,#score do
player:SaveNumber(score[i].Name,score[i].Value)
end
end
end

game.Players.PlayerAdded:connect(onPlayerEntered)
game.Players.PlayerRemoving:connect(onPlayerLeaving)



~ Thanks for playing. Come again.
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
21 Sep 2016 02:59 PM
uhh, just rewrite it?


Report Abuse
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
21 Sep 2016 03:00 PM
When I go to switch Data Persistence to a Data Store, won't I lose the DP stats?
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
21 Sep 2016 03:01 PM
Almost certain you will, but it'll be better in the long run using something that isn't deprecated


Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
21 Sep 2016 03:03 PM
if player:LoadNumber(junk) ~= default then
--save old data
end
Report Abuse
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
21 Sep 2016 03:03 PM
I don't think the people who have been using the game would appreciate lost progress.
I've been using DP to track race wins, so if people who have won over a hundred races loses that, that's obviously an issue....

Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
21 Sep 2016 03:04 PM
read my post
Report Abuse
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
21 Sep 2016 03:05 PM
How would I use that? Input that to the DP, DS, or it's own script?
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
21 Sep 2016 03:05 PM
you could save the existing data to a datastore, when the player joins use datapersistence to retrieve their wins or whatever, then insert that into a datastore. if you're doing this for a game then just post something like "join within 3 weeks unless u want to lose your stuff blah blah blah" so that people who care about their wins can join, have them save over to datastores, and then after that period remove datapersistence and convert solely to datastores.


Report Abuse
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
21 Sep 2016 03:08 PM
During the 3 weeks that both dp and ds are in the same server, would they still be able to earn more (in this case) wins and it would continue to convert from dp to ds?
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
21 Sep 2016 03:09 PM
when the player initially joins the game for the first time when this is added, load it from datapersistence and generate a key and that value within a datastore. from that point forward, every time they gain a win check for that key within your wins datastore, and if it exists update it and if it doesnt create it. don't save anything else to datapersistence, it will only hinder you.


Report Abuse
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
21 Sep 2016 03:13 PM
Alright, so, you said some words there, but none of that means anything to me, to be honest.

Like, I'll be honest, that I'm a complete Lua scrub.
I understand like some of the if hit then change color and like physical changes.
I get lost on the functions and stuff like this.... :[
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
21 Sep 2016 03:14 PM
then idk how to help


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image