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 |
|
|
| |
|
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 |
|
|
| |
|
dddylan98
|
  |
| Joined: 16 Jul 2008 |
| Total Posts: 1497 |
|
| |
|
|
| 28 Jun 2012 11:15 AM |
| Maybe the save IS working, but isn't LOADING? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 28 Jun 2012 11:21 AM |
NicNacs right.
~thedestroyer115, master RPG maker~ |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
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 |
|
|
| |
|
|
| 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 |
|
|
|
| 28 Jun 2012 01:15 PM |
| legokid, I need help. I posted a new thread. |
|
|
| Report Abuse |
|
|
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 |
|
|