[RELEASE][ESX] Shit and Piss

Hi All,

Here is my initial commit to my Shit and Piss resource. This resource adds the need for the player to go to the toilet and take a shit or piss. Both are separate making the player having to focus on both. When the players bladder reaches 100% they will get a notification saying they need either a shit or a piss. When the percentage reaches 120% they will piss or shit themselves, creating some interesting RP situations.

I am aiming to make this cleaner and more effective to use on servers as the script at the moment is very unoptimized and lengthy. Ill be updating it in time.

If you want to contribute to this please open an issue on the GitHub and let me know. Please dont reply to this post with LUA snippets as it just gets confusing.

Installation:

Down the resource from this GitHub and drag into resources folder. Add “start esx_shitandpiss” to server.cfg. Configure to your liking!

Video

Have fun and stay awesome!

-Catraz

4 Likes

video isnt uploaded yet :smiley:

Yh its pending now

1 Like

“You have shit yourself.”

1 Like

Funny release :rofl::rofl: , can i post a vrp version of it :ok_hand:?

1 Like

‘interesting RP’ :thinking:

1 Like

this just looks like a edit of a piss/shit script that’s been out for a long time

1 Like

A piss and shit script was originally released by Faxes but only includes the animations and commands.
This adds the percentage and shitting yourself mechanic as well as the ability to use ESX functions.
Always looking for feedbacks and suggestions if you want something else added.

so its just a remake of faxes maybe you should give him some credit for his work ?

It’s not a remake of Faxes though is it. The only things the same are the animations, which he didn’t make.

Like I said this adds the functionality of ESX support for people to use further and the necessity to shit and piss rather than just having the command.

The thing with scripting is that there are many ways to complete the same objective. There is not right and wrong way to do things. I’ve the same objective as Faxes but taken it further.

I’ll tag Faxes for him to comment for himself.
@FAXES

1 Like

Ahh wonderful! I’ll start the resource right after my “ButtFuckIsland” one.

Interesting release!

Either way. I don’t care as mine is basic as well as I believe it doesn’t have a license with it so do whatever. It was not a serious release of mine so I could care less. Instead of calling people out in there topics. Make a PM with them. Speak to them add the other person like myself in this scenario and problems can be solved much better.

4 Likes

A little improvement

-- CONFIG --
-- How long it takes for the percentage to add one % for piss
DelayPiss = 30
-- How long it takes for the percentage to add one % for shit
DelayShit = 50
-- Enable the Debug HUD on the right of the screen allowing the user to see their piss and shit percentage
EnableDebugHUD = true


-- DO NOT TOUCH BELOW HERE --
ESX = nil
piss = 0
shit = 0

RegisterCommand("piss", function(source, args, rawCommand)
    handle_piss() 
end, false)

RegisterCommand("shit", function(source, args, rawCommand)
    handle_shit() 
end, false)

Citizen.CreateThread(function()
	while ESX == nil do
		TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
		Citizen.Wait(0)
	end
	RequestAnimDict("missbigscore1switch_trevor_piss")
	while not HasAnimDictLoaded("missbigscore1switch_trevor_piss") do
		Citizen.Wait(100)
	end
	RequestAnimDict("switch@trevor@on_toilet")
	while not HasAnimDictLoaded("switch@trevor@on_toilet") do
		Citizen.Wait(100)
	end
end)

-- Handle Piss Incrementation
Citizen.CreateThread(function()
	local ped = PlayerPedId()
	while true do
		Citizen.Wait(DelayPiss * 1000) -- Delay in incrementation in milliseconds
		if not IsEntityPlayingAnim(ped, "missbigscore1switch_trevor_piss", "piss_loop", 3) then
			piss = piss + 1
		end
	end
end)

-- Handle Shit Incrementation
Citizen.CreateThread(function()
	local ped = PlayerPedId()
	while true do
		Citizen.Wait(DelayShit * 2000) -- Delay in incrementation in milliseconds
		if not IsEntityPlayingAnim(ped, "switch@trevor@on_toilet", "trev_on_toilet_exit", 3) then
			shit = shit + 1
		end
	end
end)

-- Handle Notfications
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if piss == 100 then
			ESX.ShowNotification("You need the toilet (Piss)")
		end
		if shit == 100 then
			ESX.ShowNotification("You need the toilet (Shit)")
		end
		if piss > 119 then
		    ESX.ShowNotification("You have pissed yourself!")
			handle_piss()
			piss = 0
		end
		if shit > 119 then
		    ESX.ShowNotification("You have shit yourself!")
			handle_shit()
			shit = 0
		end
	end
end)

-- Handle HUD
Citizen.CreateThread(function()
    while true do
    	Citizen.Wait(0)
    	if EnableDebugHUD then
	        textPiss(piss)
	        textShit(shit)
	    end
    end
end)

function handle_shit()
    local ped = PlayerPedId()
    if not IsEntityPlayingAnim(ped, "switch@trevor@on_toilet", "trev_on_toilet_exit", 3) then
        TaskPlayAnim(ped, "switch@trevor@on_toilet", "trev_on_toilet_exit", 8.0, -8, -1, 49, 0, 0, 0, 0)
        SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
		ESX.ShowNotification("You are taking a shit!")
        Citizen.Wait(8000)
        while IsEntityPlayingAnim(ped, "switch@trevor@on_toilet", "trev_on_toilet_exit", 3) and shit > 0 do
            Citizen.Wait(1)
            if (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
                ClearPedTasksImmediately(ped)
                break
            end
			shit = shit - 0.1
        end
        ClearPedTasksImmediately(ped)
    end
	return
end

function handle_piss()
    local ped = PlayerPedId()
    if not IsEntityPlayingAnim(ped, "missbigscore1switch_trevor_piss", "piss_loop", 3) then
        TaskPlayAnim(ped, "missbigscore1switch_trevor_piss", "piss_loop", 8.0, -8, -1, 49, 0, 0, 0, 0)
        SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
		ESX.ShowNotification("You are taking a piss!")
        Wait(8000)
		while IsEntityPlayingAnim(ped, "missbigscore1switch_trevor_piss", "piss_loop", 3) and piss > 0 do
            Citizen.Wait(1)
            if (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
                ClearPedTasksImmediately(ped)
                break
            end
			piss = piss - 0.1
        end
        ClearPedTasksImmediately(ped)
    end
	return
end

function textPiss(content) 
    SetTextFont(0)
    SetTextProportional(0)
    SetTextScale(0.2,0.2)
    SetTextEntry("STRING")
    AddTextComponentString("Debug: Bladder (Piss): " ..content.."%")
    DrawText(0.84,0.62)
end


function textShit(content) 
    SetTextFont(0)
    SetTextProportional(0)
    SetTextScale(0.2,0.2)
    SetTextEntry("STRING")
    AddTextComponentString("Debug: Bowl (Shit): " ..content.."%")
    DrawText(0.84,0.65)
end
1 Like

Nice script, Keep doing this kind of stuff.
But what is the esx part ? Why not just using the esx qalle needs ? It is a similar script but shit increases when you eat or drink.

So I didn’t know Qalle Needs existed.

Looking at it, it seems like a version of this with bars and a menu and in more detail.

So I guess the positive that mine is simple.

I used that script a lot and changed it a lot too do
That is why I know about it.

But that is ok. Make your own version and improve it. A more simple one can be useful too.

share your updated script?