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: Save and Load instance

Previous Thread :: Next Thread 
3DReality is not online. 3DReality
Joined: 08 Mar 2015
Total Posts: 150
06 Apr 2016 11:08 AM
game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
local PR = p:LoadInstance("Saves")
if PR then
PR.Parent = p
end
end)


game.Players.PlayerRemoving:connect(function(plr)
local Modelcheck = plr:FindFirstChild("Saves")
if Modelcheck then
plr:SaveInstance("Folder", plr:FindFirstChild("Saves"))
end
end)

Am I setting this up correct? I havent used it in awhile and this is how I set it up in a test area of myn. However its not want to save/load correct. I get no error when saving or loading but when I trying accessing the Saves folder I get nil.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
06 Apr 2016 11:10 AM
DataPersistence is bad
Report Abuse
3DReality is not online. 3DReality
Joined: 08 Mar 2015
Total Posts: 150
06 Apr 2016 11:16 AM
Look if you enjoy DataStore and converting everything into StringValues then thats great. Just saying its bad helps none.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
06 Apr 2016 11:17 AM
Wrong
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
06 Apr 2016 11:20 AM
I highly recommend you use Data Stores instead. Data Persistance has be deprecated for some time now and are prone to many problems. One of the main reasons it is deprecated is because it was prone to data loss. For instance, if a player crashes, poof goodbye that person 5.0 kdr on some fps and he would have to restart all over again. I urge you to try out Data Stores for saving instances.


Report Abuse
3DReality is not online. 3DReality
Joined: 08 Mar 2015
Total Posts: 150
06 Apr 2016 12:13 PM
@RecurringNightmare
Yes it is. Saying "DataPersistence is bad" Is not helping the problem
or finding a solution to it.


@TimeTicks
Data Stores cat be used to save instances. The only way I could do it. Is convert everything
into stringvalues and convert it back into models ect.
How could you do that. Lets say give the player there own home to customize?
Were talking about a customized house with furniture that could be all over the place.
So just saving a model or in my case a folder. Using Data Persistance is better for what
I am trying to do. Also if your saving something as simple as a KDR then yeah use Data Stores
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
06 Apr 2016 12:22 PM
Data Persistence isn't better in any case. You're better off saving string values then cloning models based on which string values the player has or..uh probably BoolValues since they're true/false so you could just search for the models by name of boolvalue then check value
Report Abuse
error9999 is not online. error9999
Joined: 05 Sep 2009
Total Posts: 1593
06 Apr 2016 12:26 PM
game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
stats = p:LoadInstance("STAT")
if stats then
print('Old Player')
stats.Parent = game.Players:findFirstChild(p.Name)
else
print('New Player')
-- give the player 'stats'
end end)





game.Players.PlayerRemoving:connect(function(p)
print('Player Removing')
p:WaitForDataReady()
getstats = game.Players:FindFirstChild(p.Name):findFirstChild('Stats')
if getstats then
p:SaveInstance("STAT", getstats)
print('Saved Value')
end end)
Report Abuse
3DReality is not online. 3DReality
Joined: 08 Mar 2015
Total Posts: 150
06 Apr 2016 12:41 PM
I do not think you are understating my point so I am going to give you a task. @ RecurringNightmare

I want you to save a custom player home. Were talking custom walls,floors,furniture,height,windows,color,material,size Like if the home was a custom build kinda like sims or like Retail Tycoon by Haggie125. Basically a custom built store and there is no model you can just clone from as its all player customization. Ontop of being able to save it. Load it on the plot of land the player owns.

Are you now understanding my point?
So in this case Data Persistence would be your best route.

Also thanks @error9999 I will try it out.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
06 Apr 2016 12:42 PM
ahh true. i guess you'd have to save its properties too then, wouldn't you
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