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 » Scripting Helpers
Home Search
 

Re: So I've been having a lot of problems with Data Persistence.

Previous Thread :: Next Thread 
Disti15 is not online. Disti15
Joined: 04 Sep 2009
Total Posts: 2652
12 Feb 2014 01:06 PM
(tl;dr below)

In my game saving and loading is very important (cookie clicker GUI game), and I added the save/load script to the StarterGui. It's the only script that is active, and when it finishes his job it activates all other scripts of the GUI after a delay.

The thing is, a month it failed sometimes, so I looked at the wiki and used pcall() and added an error message if it failed. Also a nice guy named Thaeh told me that I needed to use metatables to check if everything loaded alright (if I remember correctly) I looked at the wiki again but I don't know what to do with metatables. A month passed with no errors from it.

And, yesterday a guy came to my place and his data reseted, and he didn't get the error message I added if the pcall() failed. Another thing is that we got disconnected from the place like 20 seconds later (no shutdowns)

The script is OK, but I can post it here if you want to. I didn't change the load script recently, it worked 2 days ago and now it sometimes fails, but sometimes works OK.



And the questions:
What should I use metatables for? Is pcall() ok for this kind of script? What should I do to make this work perfectly?

Thank you :)

tl;dr: My save system fails even with a pcall(), what should I do to make it work? The script is OK, and I can post it here. Ask more if you want.

Report Abuse
Disti15 is not online. Disti15
Joined: 04 Sep 2009
Total Posts: 2652
12 Feb 2014 02:16 PM
b1
Report Abuse
xXmodzXx123 is not online. xXmodzXx123
Joined: 10 Jun 2012
Total Posts: 1874
12 Feb 2014 02:18 PM
http://wiki.roblox.com/index.php?title=Data_Persistence_Tutorial
http://wiki.roblox.com/index.php?title=SaveString_(Method)
http://wiki.roblox.com/index.php?title=LoadString_(Method)
http://wiki.roblox.com/index.php?title=WaitForDataReady_(Method)
Report Abuse
Disti15 is not online. Disti15
Joined: 04 Sep 2009
Total Posts: 2652
12 Feb 2014 04:02 PM
@above

Thank you, but I already have that in my script.

Basically, the script is:

if not pcall(function()
-- loading stuff here
end) then
--error message
else
--activate all the other scripts
end

Should I pcall() something before, then if it works pcall() all the other stuff, or what?

Thanks again.
Report Abuse
Disti15 is not online. Disti15
Joined: 04 Sep 2009
Total Posts: 2652
12 Feb 2014 05:23 PM
bump, please, I need help or else my game will make no sense :S
Report Abuse
Disti15 is not online. Disti15
Joined: 04 Sep 2009
Total Posts: 2652
13 Feb 2014 07:19 AM
b2
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
13 Feb 2014 08:24 AM
--Here is how SH works

if post.Parent:FindFirstChild("ScriptToFix") then
post.Parent.ScriptToFix:GetFixedByCommunity()
else print("we want scriptz and brainz")
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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