💩 Player Hygiene - Shower , Poop , Pee

local hygiene,poo,pee = nil,nil,nil
RegisterNetEvent("esx_status:onTick")
AddEventHandler("esx_status:onTick", function(vitals) -- use renzu_status
       for k,v in pairs(vitals) do
          if v.name == 'hygiene' then
             hygiene = v.val
          end
          if v.name == 'pee' then
             pee = v.val
          end
          if v.name == 'poop' then
             poo = v.val
          end
       end
end)

the

hygiene,poo,pee

will return the current value of the status

Upgraded to latest version and items are not usable anymore :frowning:

I have players pooping and peeing all over the city, trying to find a way to make it for our city. Also trying to turn down the pee and pooping ever 5 mins lol. Other than that I am dying laughing working with this lol

1 Like

Can you check the spelling of the item?

@hollywoodiownu

The poo and pee value from config should be is
Higher = slower Smaller = faster
The formula uses a ÷
I will change the formula soon so its not confusing

When you restart the script it adds the items to the sql twice or is trying to
I like it tho,
It would be dope if they pooped once a day, and pee twice to 4 times.

its checking only,
just tweak the config.lua

config.hygieneremove = 100 -- value to remove per tick (if using renzu_status check the multiplier)
config.thirst_to_pee = 50 -- thirst to pee convertion, pee will add if you gain thirst (ex. from drinking water item)
config.hunger_to_poo = 50 -- hunger to poo convertion, poo will add if you gain hunger (ex. from eating burger item)

this is main config which controls the speed of status degration
the poo and pee, needs to be higher to be a slower degration.

also dont forget esx_status tick have a default remove value, in my case its default 100 points.

you can see it on register status event ex. in basicneeds

If you restart it, it will try to add the items to the data base again. Can you add just a sql file and not an injection?

And if everyone is together they poop and pee together

that is weird, the script is tested in many people, and the bug you are saying does not exist or does not happen atleast in our case.

just double check your poo and pee setting, how long is the duration till the poop execute again after full?

Literally they are not defined as usable anymore

thats how i register the item, on loop.

check the BVLGARI its should be bvlgari only , its a typo

let me know if the latest commit fixes your problem,
it seems the print is causing the error.

  • Changelog
  • new formula for easy understanding
  • less value on config (you need to reconfigure it for faster degration)
  • added test commands /shower /toilet , (spawn props)
  • Fix Server print error.

Unfortunately no. Items are still not usable no error or something

Try uncommenting line 39 up to 56

results = SQLQuery(config.Mysql,'fetchAll',"SELECT * FROM items WHERE name = @name", {
                ['@name'] = k
            })
            if results[1] == nil then
                local weight = 'limit'
                if config.weight_type then
                    SQLQuery(config.Mysql,'execute',"INSERT INTO items (name, label, weight) VALUES (@name, @label, @weight)", {
                        ['@name'] = v.name,
                        ['@label'] = ""..v.name.."",
                        ['@weight'] = 1
                    })
                else
                    SQLQuery(config.Mysql,'execute',"INSERT INTO items (name, label) VALUES (@name, @label)", {
                        ['@name'] = v.name,
                        ['@label'] = ""..v.name.."",
                    })
                end
            end

So I checked the lines and they were uncommented, but saw the ‘limit’ while I am on esx legacy. Changed it to ‘weight’ and worked now :slight_smile:

1 Like

Hmm weird so limit type have issue right?

Ill make sure to fix that too…
Glad it works now to you

1 Like

I don’t think that limit type has an issue, it would work good on esx 1.1 you just have to define there what you use actually

oh i see , but the default config is weight right? are you using esx 1.1 recently?

yeah it is weight indeed as default you just need to make it ‘weight’ also on the line that reads the item from the sql querry in your next commit :smiley:
and no, I’d rather die than use this shit xD

your right i miss this dumb error lol.

1 Like