Jump to content

First script, issue with interacting with objects


Lone

Recommended Posts

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
Link to comment
Share on other sites

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