![]() |
playing with inventory
Im trying to make somthing to do with inventory. How would I do this. I want to have NPCs that the player gets and every time they get them i want it to add 1 to the inventory but also to a string or somthing. This way they can get 3 of the NPC and it shows 3 in the inventory but wont allow them to get more until they go to some place and use it up. For example:
On bread baking on 2001, say you could carry 3 things of wheat. It showed 3 wheat symbols in the inventory. Then they had to carry it back to the bread place and they would walk to a table and 1 one disappear from the inventory leaving 2 wheat icons. Then the actions would happen. After making the first bread they had 2 wheats left. They can either go get another to make 3 there or just use up the other 2. How would this work. I dont know how to make it take 1 away from the inventory. |
Well, you could do it so everytime a person gets wheat (or whatever else) it adds to a string.
NPC Code: Then to read the string you could make it like when you touch an NPC he does this: NPC Code: I hope that helps =) If it doesn't IM me, I can help you work it out. |
toinventory flag; is pretty buggy. I wouldn't recommend using it. First off, if you disconnect then reconnect your items don't show up again in your inventory place. Second off, once you unset flag, all the items in your inventory under that flag go bye bye.
|
~AlphaFlame~
If you want it to show up multiple times... do like this toweapons /the-weapon-name; I believe that works ;) |
i think i will just go with shard's idea and use a string and not inventory. The only reason i wanted to use inventory is cuz it actually shows an image of what the player has.
|
You could program your own inventory script...
|
~AlphaFlame~
While in essence making your own inventory script is good, it's not preferable... if it's simply multiple of an item you want, just use toweapons /(item name); Using that, the item will more or less go to the inventory under the same name multiple times. Handy for stuff like potions... |
or...
i was thinkin, i may be wrong but, you could use the set command and while command.
if (playerenters){toweapons test;set 1;} while (1){setimg 1.gif;} theres one npc if (playerenters&&1){toweapons test; set 2; unset 1;} while (2){setimg 2.gif;} second one. and so on and so on. im half awake so if this doesnt work dont b*tch at me. :rolleyes: |
Hmmm
Use flags, and the toinventory \thing Like if (wheat&&!wheat1) { towhatever \whaterver; } I know that probly confused -Freaky- |
~AlphaFlame~
DO NOT USE FLAGS! NO NO NO PERIOD! If you have to use flags for that, then shoot yourself, and stop scripting. if (playertouchsme){ if (!hasweapon(Wheat 1) && !hasweapon(Wheat 2) && !hasweapon(Wheat 3)){ toweapons Wheat 1; break; } if (hasweapon(Wheat 1)){ toweapons Wheat 2; break; } if (hasweapon(Wheat 2)){ toweapons Wheat 3; break; } } Would be more efficient than the flags. And that's not much better. And besides, the toweapons / will add that NPC MULTIPLE times to your inventory ANYWAY. |
| All times are GMT +2. The time now is 08:40 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.