-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use statebags for hunger/thirst/stress #395
Conversation
I tried to test this, there was an error on line 10 about compare nil with number and in the console it was arithemetic on nil value server/loops.lua:6 |
Try again now, errors makes sense if the values aren't set to begin with 😆 |
Yes, this works well, there are no errors, I found several problems, when I eat it does increase in the bar, but when I continue eating it gets stuck and doesn't add any more, and when I drink it's the same, what's there actually decreases. |
That's weird, i don't really see why that would happen, tbh 🤔 |
I'm experiencing the same issue too. When I use this with your hud pr, the first time I eat it updates but after that, it doesnt update anymore from what I can tell. |
@Fraprwnt can you please update core smallresources & hud and try again now? :) |
to eat using items from ox_inventory remains the same. It only increases after the first meal. The second and third don't change anything, but to eat using items from the smallresources config, for the first and second meal the same amount of food and drink increases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metadata must always be modified using the SetMetadata function of player. Otherwise certain events won't fire, which are relied upon for updating QBX.PlayerData for example, and likely used in other scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix listing errors and make sure this is thoroughly tested please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as it's been thoroughly tested.
Description
Statebags are cool 👍
It keeps compatibility with the old way of setting those values, so we can start using statebags without anything being broken until then!
(please test to make sure i didn't fuck it up)
Checklist