• 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!

Forever Food

simson361

The Grim Reaper
Joined
Aug 4, 2010
Messages
626
Reaction score
27
Location
sweden
im serching for a script/mod that dose that a sertain food itemid "11130" can never run out of food :)


if there is any thread alredy about it please do link i cudnet find it on search... :(
 
Well I'm not good at this, but I'll give it a try.

Add this in your actions.xml.
Code:
<action itemid="11130" event="script" value=" location and name of the lua file "/>

And create a file containing this.
Code:
function onUse(cid, item, itemEx)
   if(getPlayerFood(cid) + 18) then
     doPlayerSendCancel(cid, "You are full.")
   return true

   doPlayerFeed(cid, 18)
   doCreatureSay(cid, "Yummie.", TALKTYPE_MONSTER)
   return true
end
 
Last edited:
@HalfAway awesome thx i will give it a try and let you know what happends :)!

@HalfAway got this error :/
Code:
[22/09/2013 00:24:47] [Error - LuaScriptInterface::loadFile] data/actions/scripts/ForeverFood.lua:6: 'end' expected (to close 'if' at line 2) near 'doPlayerFeed'
[22/09/2013 00:24:47] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/ForeverFood.lua)
[22/09/2013 00:24:47] data/actions/scripts/ForeverFood.lua:6: 'end' expected (to close 'if' at line 2) near 'doPlayerFeed'
 
Last edited by a moderator:
Code:
function onUse(cid, item, itemEx)
   if(getPlayerFood(cid) + 18) then
      return doPlayerSendCancel(cid, "You are full.")
   end
   doPlayerFeed(cid, 18)
   doCreatureSay(cid, "Yummie.", TALKTYPE_MONSTER)
   return true
end
 
Code:
function onUse(cid, item, itemEx)
  if(getPlayerFood(cid) + 360) then
  return doPlayerSendCancel(cid, "You are full.")
  end
  doPlayerFeed(cid, 18)
  doCreatureSay(cid, "Yummie.", TALKTYPE_MONSTER)
  return true
end

You can change the mana/hp for each vocation in data/XML/vocations.xml
 
Code:
function onUse(cid, item, itemEx)
  if getPlayerFood(cid) + 15 >= 400 then
    return doPlayerSendCancel(cid, "You are full.")
  end

  doPlayerFeed(cid, 60)
  doCreatureSay(cid, "Yummie.", TALKTYPE_MONSTER)
  return true
end
 
Back
Top