Jump to content

Need help getting item count from inventory on start


Alakazizam

Recommended Posts

5 hours ago, Alakazizam said:

I'm trying to set a variable on start from my inventory but it sets it to 0. I'm assuming because it's triggering before the character is actually loaded in. How can I go about this?
 

onStart should always run after being logged in, very rarely it could happen earlier.
You sure your code is correct? I use this in a lot of my scripts and never heard of an issues with this

  • Like 1
Link to comment
Share on other sites

7 hours ago, Alakazizam said:

I'm trying to set a variable on start from my inventory but it sets it to 0. I'm assuming because it's triggering before the character is actually loaded in. How can I go about this?
 

how about setting the default value to null and make it get the count in the onloop if the var is still null 

  • Like 1
Link to comment
Share on other sites

4 hours ago, Khaleesi said:

onStart should always run after being logged in, very rarely it could happen earlier.
You sure your code is correct? I use this in a lot of my scripts and never heard of an issues with this

I'll have to try again. Was burnt out this morning and may have messed up some maths lol

 

 

2 hours ago, xcx said:

how about setting the default value to null and make it get the count in the onloop if the var is still null 

Going to try to get the onStart method working again, but if that doesn't work out this is probably a good work around.

Link to comment
Share on other sites

1 hour ago, Alakazizam said:

I'll have to try again. Was burnt out this morning and may have messed up some maths lol

 

 

Going to try to get the onStart method working again, but if that doesn't work out this is probably a good work around.

I mean if it really won't load the inventory, could do a conditionalSleep until 

myPlayer().exists(); or getInventory() !=null
  • 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...