![]() |
level classes saving?
I have a class which is joined by a level NPC (not putnpc2) which is a door. I've added a feature where you can lock and unlock your house door. However, it's not saving this flag, it's as though it's resetting after some time.
Putnpc2 saves these flags and only change them when necessary- but level joined npcs revert to the origional code if someone enters and it hasn't been entered in a while (onCreated is called again) Is there any way to store this flag without it being wiped? I was thinking of making it a level variable, but wouldn't that just do the same thing? (clear it after someone enters after it's been empty for some time) thanks |
When a level is inactive for 10 or so minutes the npc is wiped from memory then when a player enters the level everything is re-created again.
As long as this.savelocally = true; Your npc should be saving that value permanently. (On iOS: the furniture class does it, so unless you're making a door that doesn't join/inherit that you'll need to set it.) So if you're setting this.unlocked to true in your onCreated function that's probably why it doesn't appear to be saving for you. |
Interesting.
That wouldn't effect the rest of the script would it? What does HTML Code:
this.savelocally = true;Oh by the way, it's not furniture. It's actually the door to lead into a house thanks |
| All times are GMT +2. The time now is 09:02 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.