Jump to content
  • 0

[Help] JScript delete item code?


Question

Posted

Hello, I would like to ask what code should i use to delete an item. I imported L2ItemInstance and PcInventory and then i tried this code:

 

getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null);

and i also tried to add st. in front, like this

 

st.getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null);

 

But still i get an error on getInventory. What can i do?

14 answers to this question

Recommended Posts

  • 0
Posted

I did it like this:

 

getPlayer().getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null);

 

but i gets an error with getPlayer :S

What can i do?

 

1st you either declare a player value or you use st.getPlayer()

2nd st is not a proper object reference st.getPlayer() is

  • 0
Posted

i used this now:

st.getPlayer().getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null);

 

Still not working :S any other idea?

it says error null :S

 

i told st is not an object reference st.getPlayer() is...

  • 0
Posted

I dont understand you lol, please tell me what to use to delete that item. im confused lol

 

for example player.destroyItemByItemId("Quest", DARION_BADGE, 20, npc, true)

 

or st.getPlayer().destroyItemByItemId("Quest", DARION_BADGE, 20, npc, true)

 

read always the method reference to see which value need what...

  • 0
Posted

i have 2, brasil and l2j, none of them working. but i am planning to use it on brasil

 

so shitlude than thats why i dont know the il methods xD

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..