• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Whats the problem in my infinite food?

zabuzo

Well-Known Member
Joined
Jun 10, 2016
Messages
238
Reaction score
54
I'm trying to make a infinity food, but i got this error:
Code:
ta/actions/scripts/foods/infinity_food.lua:onUse
[15:26:25.811] Description:
[15:26:25.811] data/actions/scripts/foods/infinity_food.lua:3: attempt to compare nil with number
[15:26:25.811] stack traceback:
[15:26:25.811]    data/actions/scripts/foods/infinity_food.lua:3: in function <data/actions/scripts/foods/infinity_food.lua:1>

Script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   local size = 180
   if(getPlayerFood(cid) + size > MAX_FOOD) then
     doPlayerSendCancel(cid, "You are full.")
     return true
   end

   doPlayerFeed(cid, size)

   doCreatureSay(cid, "Hmmm.", TALKTYPE_MONSTER)
   return true
end
 
Back
Top