=D!
Open data/actions/scripts/other/food.lua and after:
Paste this:
Now, go to data/creaturescripts/scripts create a file called diarrhea.lua and paste this inside:
Paste this in login.lua:
And this in creaturescripts.xml:
Enjoy !
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 !
Last edited: