Ferseus
|
  |
| Joined: 23 May 2013 |
| Total Posts: 247 |
|
|
| 19 Dec 2013 03:07 PM |
local d = Player:LoadNumber("Saved Data") if d then --Script
Will that work? Im trying to make it check if the player has saved any data. |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 19 Dec 2013 03:09 PM |
| No. If the key doesn't exist it will return '0', not false. |
|
|
| Report Abuse |
|
|
Ferseus
|
  |
| Joined: 23 May 2013 |
| Total Posts: 247 |
|
|
| 19 Dec 2013 03:19 PM |
| Well how would I do it then? |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 19 Dec 2013 03:25 PM |
| Check to see if the value is equal to zero...? If it is, and if it shouldn't be at any point in your game, then do what you want to do with it. |
|
|
| Report Abuse |
|
|
Ferseus
|
  |
| Joined: 23 May 2013 |
| Total Posts: 247 |
|
|
| 19 Dec 2013 03:41 PM |
| Well then what if I saved an instance and I wanted to check if a player saved that instance? |
|
|
| Report Abuse |
|
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
|
| 19 Dec 2013 03:43 PM |
if Player:LoadNumber("Saved Data") ~= 0 then --stuff end |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 19 Dec 2013 03:44 PM |
@Fer, In the case of LoadInstance it will return nil if the 'key' you're using doesn't exist for that place. |
|
|
| Report Abuse |
|
|
Ferseus
|
  |
| Joined: 23 May 2013 |
| Total Posts: 247 |
|
|
| 19 Dec 2013 03:46 PM |
| Im trying to check if the player has ever saved so the load script im making doesnt glitch if the player doesnt have any data! Sorry for all the pressure, data persistence is just the hardest scripting for me |
|
|
| Report Abuse |
|
|