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: ...generating 'Cannot save a null instance' error

Previous Thread :: Next Thread 
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 07:45 PM
Yeah, so I'm getting trolled by Roblox. D:

The subject explains it all.

Literally all I'm doing is player:SaveInstance((a string property for key),nil) and it errors:
>Cannot save a null instance

Okay, herp-derp Roblox, how do you suppose I delete a Saved instance, then?
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 08:03 PM
bump
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 08:13 PM
bump
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 08:21 PM
This makes no sense, everywhere in the wiki, and in common DP knowledge it's said that in order to delete a saved-instance you just have to save nil to it, to delete a saved-number you just have to save 0 to it, and to delete a saved-string you have to save "" to it. So, how come when I'm trying to save nil to a SaveInstance I get an error saying that I cannot save a null (<- output says null, when in Lua it's nil) instance.

I've looked everywhere for a solution now, well searched google quite a few times using different words, and I can't find any solutions, any, well, anything for this.
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 08:27 PM
bump
Report Abuse
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
25 May 2012 08:29 PM
Why not save the instance, then destroy it without saving???
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 08:30 PM
Lolwut?

That makes no sense.
Report Abuse
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
25 May 2012 08:41 PM
Nevermind, thought it was something else.

So you went:

SaveInstance(Nil,key)

?
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 08:45 PM
Lol, no..
That wouldn't work at all, seeing as how it's SaveInstance(key,value), so I went SaveInstance((the key),nil)
Report Abuse
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
25 May 2012 08:48 PM
Nope, you have it backwards, that's your problem.
Report Abuse
Legend26 is not online. Legend26
Joined: 08 Sep 2008
Total Posts: 10586
25 May 2012 08:51 PM
It's indeed SaveInstance(string, object), I'm not sure how you're gonna delete it then if it's going to error like that...
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 08:54 PM
>It's indeed SaveInstance(string, object), I'm not sure how you're gonna delete it then if it's going to error like that...

Ikr?! RAGE. D:<

Also, for anyone saying it's a syntax error, just look at the error... 'Cannot save a null instance', what part of that suggests a syntax error?
Report Abuse
BuildPersonalServer is not online. BuildPersonalServer
Joined: 30 Dec 2011
Total Posts: 2
25 May 2012 09:02 PM
Erm...

SaveInstance(string, object)
player:SaveInstance((a string property for key),nil)

Well, nil isn't an object. LOL.

MrMcAero
Report Abuse
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
25 May 2012 09:02 PM
Oh darn, read the wiki wrong! =P
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 09:05 PM
*facepalm*

Are you serious?

Read the wiki about data persistence, they added a way for each Save function to delete data, for SaveInstance it's nil, for SaveString it's "", for SaveNumber it's 0. (SaveBoolean I guess doesn't have one, never mentioned)
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 09:06 PM
And that was @BuildPersonalServer btw, forgot to say.
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 09:27 PM
I really need a solution, but I have no idea what the solution would possible be.
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 09:54 PM
I'm not letting this go.

Bump.
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 10:32 PM
bump
Report Abuse
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
25 May 2012 11:05 PM
Replace the instance with an explosion?
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 11:08 PM
How would that delete it? An explosion is an existing object, therefore it will save that object, not nil. o-o
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
01 Jun 2012 12:27 PM
I waited awhile to see if it was just a bug that would go away, but just tried again, still happening.

Is there somewhere else I should go with this that will get the attention of someone that can actually help me with this? (Like a roblox developer)
Because this isn't a scripting error, it's a bug with SaveInstance.
Report Abuse
av83r is online. av83r
Joined: 28 Jul 2009
Total Posts: 2580
01 Jun 2012 12:29 PM
change the instance to 0 instead of nill. Probably not exactly what you want, but it will work.
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
01 Jun 2012 12:34 PM
@av83r I knew that wouldn't work because it's a number value, SaveInstance needs to have a object value, but just to make sure I tried anyway, and just as I suspected it generated a "cannot cast value to object" error.
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
01 Jun 2012 12:43 PM
bump
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