Jump to content

First script, issue with interacting with objects


Recommended Posts

Posted (edited)

Hi I believe the issue will be in my case CHOP if more code is needed I can post it all just want to keep it simple.

 

case CHOP:
    RS2Object tree = getObjects().closest("Tree");
    if (tree != null){
    tree.interact("Chop-down");
    }
    break;
 
kPOugb5.gif
As you can see it just floats over the object never interacting with it.
Edited by Bradf3rd
Posted

This is due to your interact string being "Chop-down", where the actual one is "Chop down". No hyphen.

 

The interact event is failing because it can't find the "Chop-down" action, since the actual one doesn't have the hyphen.

 

 

Make sure to use the correct names smile.png

Chop-down -> Chop down

Thank you both! In the guide I saw a snippet of code "stall.interact("Steal-from");" so I thought it all was like that.

  • Like 1

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
  • Recently Browsing   0 members

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