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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...