• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Diarrhea System

Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
188
Location
Venezuela
=D!

Open data/actions/scripts/other/food.lua and after:
Lua:
	doRemoveItem(item.uid, 1)

Paste this:
Lua:
-- diarrea chance in %
local diarrheaChance = 100
local diarrheaStorage = 63215

	if(math.random(100) <= diarrheaChance) then
		if(getPlayerStorageValue(cid, diarrheaStorage) < 0) then
			doPlayerSetStorageValue(cid, diarrheaStorage, 0)
		end
		doPlayerSetStorageValue(cid, diarrheaStorage, 1)
		doCreatureSay(cid, "Damm... I get Diarrhea!", TALKTYPE_MONSTER)
	end

Now, go to data/creaturescripts/scripts create a file called diarrhea.lua and paste this inside:
Lua:
function onThink(cid, interval)

local chanceToRemoveDiarrhea = 1
local diarrheaStorage = 63215
local msg = 
{
	"Damm.. the Diarrhea is killing me!",
	"Oh Crap! my pants are dirty.",
	"What's that smell?"
}

	local interval = interval + 1
	if(interval >= 10) then
		if(getPlayerStorageValue(cid, diarrheaStorage) > 0) then
			if(math.random(100) >= 50) then
				doCreateItem(2016, 3, getCreaturePosition(cid))
			end
			if(math.random(100) <= 30) then
				doCreatureSay(cid, msg[math.random(1, table.maxn(msg))], TALKTYPE_MONSTER)
			end
			if(math.random(100) <= chanceToRemoveDiarrhea) then
			doPlayerSetStorageValue(cid, diarrheaStorage, 0)
				doCreatureSay(cid, "Oh yeah! my ass is happy.", TALKTYPE_MONSTER)
			end
		end
		interval = 0
	end
	return true
end

Paste this in login.lua:
Lua:
	registerCreatureEvent(cid, "Diarrhea")

And this in creaturescripts.xml:
PHP:
	<event type="think" name="Diarrhea" event="script" value="diarrhea.lua"/>

Enjoy :p!
 
Last edited:
Lol strange script...

but nicely done. xD
 
Back
Top