July 13, 20232 yr 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?
July 13, 20232 yr 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
July 13, 20232 yr 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
July 13, 20232 yr Author 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.
July 14, 20232 yr 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
Create an account or sign in to comment