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: Data Persistency... -__- Y U NO WORK

Previous Thread :: Next Thread 
dddylan98 is not online. dddylan98
Joined: 16 Jul 2008
Total Posts: 1497
28 Jun 2012 09:30 AM
Save Script:

function leave(plr)
if plr.DataReady then
plr.PlayerGui.Tycoon.Money.Money:SaveNumber("Money", plr.PlayerGui.Tycoon.Money.Money.Value)
end
end

game.Players.PlayerRemoving:connect(leave)


Load Script:

function playerAdded(plr)
plr:WaitForDataReady()
load = plr:LoadNumber("Money")
plr.PlayerGui.Tycoon.Money.Money.Value = load
end
game.Players.PlayerAdded:connect(playerAdded)


Its probably some stupid mistake... -__-
Report Abuse
AlbinoDerpasaurusRex is not online. AlbinoDerpasaurusRex
Joined: 09 Jun 2012
Total Posts: 248
28 Jun 2012 09:58 AM
[ Content Deleted ]
Report Abuse
dddylan98 is not online. dddylan98
Joined: 16 Jul 2008
Total Posts: 1497
28 Jun 2012 10:03 AM
I've never used pcall... Care to elaborate? :P
Report Abuse
AlbinoDerpasaurusRex is not online. AlbinoDerpasaurusRex
Joined: 09 Jun 2012
Total Posts: 248
28 Jun 2012 10:23 AM
[ Content Deleted ]
Report Abuse
dddylan98 is not online. dddylan98
Joined: 16 Jul 2008
Total Posts: 1497
28 Jun 2012 10:43 AM
But the Save should work?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
28 Jun 2012 11:15 AM
Maybe the save IS working, but isn't LOADING?
Report Abuse
dddylan98 is not online. dddylan98
Joined: 16 Jul 2008
Total Posts: 1497
28 Jun 2012 11:20 AM
Well you can't test if the Save is working if the load isn't xP
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
28 Jun 2012 11:20 AM
It's never a good idea to save when the player is leaving. Never.
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
28 Jun 2012 11:21 AM
NicNacs right.

~thedestroyer115, master RPG maker~
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
28 Jun 2012 11:22 AM
@MrNicNac,

I do it, and my DP Script works just fine. It's also great incase of an Exploited Server, You can disable the script before Shutting down to prevent Peoples' Stats from being messed up
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
28 Jun 2012 11:23 AM
That's great. But it isn't a for-sure working. I've had many problems with it before - and I'm sure that I was doing it right.

Whenever I see threads like this, changing the method to save whenever the value is changed has always fixed it.
Report Abuse
dddylan98 is not online. dddylan98
Joined: 16 Jul 2008
Total Posts: 1497
28 Jun 2012 11:32 AM
So here is what I will try: create a save button gui that uses the same code except for using plr and PlayerRemoved, do script.Parent.etc until I hit the player?
Report Abuse
1pie23 is not online. 1pie23
Joined: 11 Jul 2010
Total Posts: 1865
28 Jun 2012 11:35 AM
I tried making the value save every time it changed, and it works.
Report Abuse
MathManiac0 is not online. MathManiac0
Joined: 17 Jul 2010
Total Posts: 72
28 Jun 2012 11:36 AM
Use pcall. It's a way to know if something succeds, and if it doesn't succeed, then it will print out an error.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
28 Jun 2012 11:37 AM
[ Content Deleted ]
Report Abuse
dddylan98 is not online. dddylan98
Joined: 16 Jul 2008
Total Posts: 1497
28 Jun 2012 11:59 AM
Fixed it with Save and Loads. Anyone know how many things I can store?
Report Abuse
AlbinoDerpasaurusRex is not online. AlbinoDerpasaurusRex
Joined: 09 Jun 2012
Total Posts: 248
28 Jun 2012 01:10 PM
[ Content Deleted ]
Report Abuse
legokid135 is not online. legokid135
Joined: 23 Jan 2009
Total Posts: 1470
28 Jun 2012 01:14 PM
function leave(plr)
if plr.DataReady then
plr:SaveNumber("Money", plr.PlayerGui.Tycoon.Money.Money.Value)
end
end

‹‹‹‹ Tihs sgintarue is esay to raed ››››
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
28 Jun 2012 01:15 PM
legokid, I need help. I posted a new thread.
Report Abuse
dddylan98 is not online. dddylan98
Joined: 16 Jul 2008
Total Posts: 1497
28 Jun 2012 02:09 PM
So if they had like 75000 stored in a NumberValue it will change to 45000?
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