sistema funciona assim se player fica muito tempo sem comer ele vai morrendo de fome
ai ele perde porcentagem do seu life e vai morrendo se não comer nada ate que ele morre
check.lua
data\talkactions\scripts
cria check.lua e coloca isso
function onSay(cid, words, param) if isPlayer(cid) and doPlayerSendTextMessage(cid, 22,"tempo ["..getPlayerFood(cid).."/1000] para comer") then return true end end
talkactions.xml
<talkaction words="!check" event="script" value="check.lua"/>
foi criando check
agora vai em
food.lua
data\actions\scripts\other
cria
food.lua
e coloca isso
local limite = 1000 -- limite não passar de 1000 local food = --[id da comida] = {quanto aumenta no limite ,"palavra."}, {[2362] = {80, "Crunch."}, [2666] = {150, "Munch."}, [2667] = {120, "Munch."}, [2668] = {100, "Mmmm."}, [2669] = {170, "Munch."}, [2670] = {40, "Gulp."}, [2671] = {300, "Chomp."}, [2672] = {400, "Chomp."}, [2673] = {50, "Yum."}, [2674] = {60, "Yum."}, [2675] = {130, "Yum."}, [2676] = {80, "Yum."}, [2677] = {10, "Yum."}, [2678] = {180, "Slurp."}, [2679] = {10, "Yum."}, [2680] = {20, "Yum."}, [2681] = {90, "Yum."}, [2682] = {200, "Yum."}, [2683] = {170, "Munch."}, [2684] = {80, "Crunch."}, [2685] = {60, "Munch."}, [2686] = {90, "Crunch."}, [2687] = {20, "Crunch."}, [2688] = {90, "Munch."}, [2689] = {100, "Crunch."}, [2690] = {30, "Crunch."}, [2691] = {80, "Crunch."}, [2792] = {60, "Munch."}, [2793] = {90, "Munch."}, [2695] = {60, "Gulp."}, [2696] = {90, "Smack."}, [2787] = {90, "Munch."}, [2788] = {40, "Munch."}, [2789] = {220, "Munch."}, [2790] = {300, "Munch."}, [2791] = {300, "Munch."}, [2792] = {60, "Munch."}, [2794] = {30, "Munch."}, [2795] = {360, "Munch."}, [2796] = {50, "Munch."}, [2793] = {90, "Munch."}, [5097] = {40, "Yum."}, [6125] = {80, "Gulp."}, [6278] = {100, "Mmmm."}, [6279] = {150, "Mmmm."}, [6393] = {120, "Mmmm."}, [6394] = {150, "Mmmm."}, [6501] = {200, "Mmmm."}, [6541] = {60, "Gulp."}, [6542] = {60, "Gulp."}, [6543] = {60, "Gulp."}, [6544] = {60, "Gulp."}, [6545] = {60, "Gulp."}, [6569] = {10, "Mmmm."}, [6574] = {40, "Mmmm."}, [7158] = {150, "Munch."}, [7159] = {130, "Munch."}, [7372] = {70, "Yum."}, [7373] = {70, "Yum."}, [7374] = {70, "Yum."}, [7375] = {70, "Yum."}, [7376] = {70, "Yum."}, [7377] = {70, "Yum."}, [7909] = {40, "Crunch."}, [8838] = {70, "Gulp."}, [8839] = {50, "Yum."}, [8840] = {20, "Yum."}, [8841] = {30, "Urgh."}, [8842] = {30, "Munch."}, [8843] = {30, "Crunch."}, [8844] = {30, "Gulp."}, [8845] = {20, "Munch."}, [8847] = {110, "Yum."} } function onUse(cid, item, fromPosition, itemEx, toPosition) if(food[item.itemid] ~= nil) then if(getPlayerFood(cid) + food[item.itemid][1]) >= limite then doPlayerSendCancel(cid, "You are full.") else doPlayerFeed(cid, food[item.itemid][1] /2.8) doCreatureSay(cid, food[item.itemid][2], TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) end return TRUE end return FALSE end
ou troca food por esse ai cima
agora vai em
deathfood.lua
data\creaturescripts\scripts
cria deathfood.lua coloca isso
--- config by notle death = 200 -- quando morre vai nascer com 200 de fome só edita tp = 500 -- com 500 de fome ja começa a morrer time = 2000 -- tempo que demora para sair life do player (1000 por segundos) life = 5 -- porcentagem --- config by notle function onLogin(cid) death_death(cid) -- não mexe death_food(cid) -- não mexe registerCreatureEvent(cid, "deathfood") return 1 end function death_death(cid) if isCreature(cid) and getPlayerFood(cid) <= 10 then doPlayerFeed(cid,death/2.8) end end function death_food(cid) if isCreature(cid) then if getPlayerFood(cid) <= tp then pc = getCreatureMaxHealth(cid)/100 doCreatureAddHealth(cid, -math.floor((pc*life))) doSendAnimatedText(getPlayerPosition(cid),"-"..math.floor(pc*life).."", math.random(144,145)) end end addEvent(death_food,time,cid) return 1 end
creaturescripts.xml
<event type="login" name="deathfood" event="script" value="deathfood.lua"/>
Creditos