![]() |
Custom Chest Help
Howdy Forums, there happens to be something wrong with my custom chest script, when it updates the chest as I put something in, it just leaves a blank line in the (Inside the chest textlist). When I take that out of the chest, THEN it removes it from my inventory. Its really weird, can someone please help me, I've posted my current script below.
NOTE TO OTHER SERVERS: Please do not take this script with my approval. Heres the chest class: PHP Code:
PHP Code:
PHP Code:
|
You need to store 'this.inside' in a DB-NPC and use chestid to make 'this.inside' unique.
I.e: this.("chest_" @ this.chestid) The Chest GUI should be created in the weapon npc. 1. Player Touches Chest 2. Call 'Chest Weapon' with Chest ID to load chest. I.e: findweapon("-GUI/Chest").loadChest(this.chestid); 3. Trigger Server: Get contents of Chest ID (optional: Check Chest Owner) I.e: triggerserver("gui", this.name, "loadChest", this.chestid); 4. Trigger Client: Contents of Chest ID I.e: player.triggerclient(this.name, "chestContents", this.contents); 5. Store Contents on Clientside and Draw Chest GUI I.e: this.contents = params[1]; I'd store the data in a DB-NPC called DB_Chests and use public functions to access and modify the data. I.e: PHP Code:
DB_Chests.getChest(chestid); DB_Chests.addToChest(chestid, weaponName); DB_Chests.removeFromChest(chestid, weaponName); DB_Chests.hasInChest(chestid, weaponName); To access and modify the contents of chests. Also keep in mind that variables you set on the server-side are inaccessible on the client-side, I would recommend using attrs to get around that. I.e: In your chest class: PHP Code:
|
| All times are GMT +2. The time now is 10:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.