Jump to content

Check for certain amount of items on the ground


Alext1996

Recommended Posts

Hello im having problem a little trouble with my script.

 

I want it to be able to check the ground, if number of items on the ground currently are more than 28 or less than 28.

 

if its less then 28 then im going to continue dropping items

 

if its more than 28 then im going to pick them up

 

but it says bad operander type I searched around and found no answer.

 

I attached a screenshot of the problem below thanks alot smile.png

 

merry christmas everyone!

post-243631-0-49403200-1482540696_thumb.png

Edited by Alext1996
Link to comment
Share on other sites

m8... isFull() is a method

!inventory.isFull()

also, your operand is backwards

 

=> is not greater than or equal to. that's an arrow.

 

>= is greater than or equal to.

 

edit: you're also trying to ask if a GroundItem (an object) is greater than or equal to 28 / less than 28.

That's like asking someone, "Is my textbook less than 20?". You can't compare an object to a number. Use getAmount().

 

it looks like you need to familiarize yourself with java a little bit more before coding.

 

Edited by Imateamcape
Link to comment
Share on other sites

m8... isFull() is a method

!inventory.isFull()

also, your operand is backwards

 

=> is not greater than or equal to. that's an arrow.

 

>= is greater than or equal to.

 

edit: you're also trying to ask if a GroundItem (an object) is greater than or equal to 28 / less than 28.

That's like asking someone, "Is my textbook less than 20?". You can't compare an object to a number. Use getAmount().

 

it looks like you need to familiarize yourself with java a little bit more before coding.

 

yeah I know isfull is a method, that is just a typo I was asking about if there is a way to check how many objects are on the ground.

 

I have watched so many tutorials on youtube im sick of it thats why i decided to start coding instead so I learn by doing

 

thanks for the help

m8... isFull() is a method

!inventory.isFull()

also, your operand is backwards

 

=> is not greater than or equal to. that's an arrow.

 

>= is greater than or equal to.

 

edit: you're also trying to ask if a GroundItem (an object) is greater than or equal to 28 / less than 28.

That's like asking someone, "Is my textbook less than 20?". You can't compare an object to a number. Use getAmount().

 

it looks like you need to familiarize yourself with java a little bit more before coding.

 

Link to comment
Share on other sites

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
Reply to this topic...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...