Jump to content

Olá Tibiano! Notamos que você está com um adblocker ligado... 

Nós promovemos servidores dentro da comunidade, para que eles tenham visibilidade.

Por favor, nos ajude a continuar promovendo esses servidores. Adicione nosso domínio na whitelist de seu adblocker, ok? :)

  • 0
Emooooo

[Resolvido] colocar exausted e storage aqui.

Question

local foods = {
    [2328] = {6, 'Gulp.'}, -- egg
    [2362] = {5, 'Crunch.'}, -- carrot
    [2666] = {15, 'Munch.'}, -- meat
    [2667] = {12, 'Munch.'}, -- fish
    [2668] = {10, 'Mmmm.'}, -- salmon
    [2669] = {17, 'Munch.'}, -- northern pike
    [2670] = {4, 'Gulp.'}, -- shrimp
    [2671] = {30, 'Chomp.'}, -- ham
    [2672] = {60, 'Chomp.'}, -- dragon ham
    [2673] = {5, 'Yum.'}, -- pear
    [2674] = {6, 'Yum.'}, -- red apple
    [2675] = {13, 'Yum.'}, -- orange
    [2676] = {8, 'Yum.'}, -- banana
    [2677] = {1, 'Yum.'}, -- blueberry
    [2678] = {18, 'Slurp.'}, -- coconut
    [2679] = {1, 'Yum.'}, -- cherry
    [2680] = {2, 'Yum.'}, -- strawberry
    [2681] = {9, 'Yum.'}, -- grapes
    [2682] = {20, 'Yum.'}, -- melon
    [2683] = {17, 'Munch.'}, -- pumpkin
    [2684] = {5, 'Crunch.'}, -- carrot
    [2685] = {6, 'Munch.'}, -- tomato
    [2686] = {9, 'Crunch.'}, -- corncob
    [2687] = {2, 'Crunch.'}, -- cookie
    [2688] = {2, 'Munch.'}, -- candy cane
    [2689] = {10, 'Crunch.'}, -- bread
    [2690] = {3, 'Crunch.'}, -- roll
    [2691] = {8, 'Crunch.'}, -- brown bread
    [2696] = {9, 'Smack.'}, -- cheese
    [2787] = {9, 'Munch.'}, -- white mushroom
    [2788] = {4, 'Munch.'}, -- red mushroom
    [2789] = {22, 'Munch.'}, -- brown mushroom
    [2790] = {30, 'Munch.'}, -- orange mushroom
    [2791] = {9, 'Munch.'}, -- wood mushroom
    [2792] = {6, 'Munch.'}, -- dark mushroom
    [2793] = {12, 'Munch.'}, -- some mushrooms
    [2794] = {3, 'Munch.'}, -- some mushrooms
    [2795] = {36, 'Munch.'}, -- fire mushroom
    [2796] = {5, 'Munch.'}, -- green mushroom
    [5097] = {4, 'Yum.'}, -- mango
    [6125] = {8, 'Gulp.'}, -- tortoise egg
    [6278] = {10, 'Mmmm.'}, -- cake
    [6279] = {15, 'Mmmm.'}, -- decorated cake
    [6393] = {12, 'Mmmm.'}, -- valentine's cake
    [6394] = {15, 'Mmmm.'}, -- cream cake
    [6501] = {20, 'Mmmm.'}, -- gingerbread man
    [6541] = {6, 'Gulp.'}, -- coloured egg (yellow)
    [6542] = {6, 'Gulp.'}, -- coloured egg (red)
    [6543] = {6, 'Gulp.'}, -- coloured egg (blue)
    [6544] = {6, 'Gulp.'}, -- coloured egg (green)
    [6545] = {6, 'Gulp.'}, -- coloured egg (purple)
    [6569] = {1, 'Mmmm.'}, -- candy
    [6574] = {5, 'Mmmm.'}, -- bar of chocolate
    [7158] = {15, 'Munch.'}, -- rainbow trout
    [7159] = {13, 'Munch.'}, -- green perch
    [7372] = {2, 'Yum.'}, -- ice cream cone (crispy chocolate chips)
    [7373] = {2, 'Yum.'}, -- ice cream cone (velvet vanilla)
    [7374] = {2, 'Yum.'}, -- ice cream cone (sweet strawberry)
    [7375] = {2, 'Yum.'}, -- ice cream cone (chilly cherry)
    [7376] = {2, 'Yum.'}, -- ice cream cone (mellow melon)
    [7377] = {2, 'Yum.'}, -- ice cream cone (blue-barian)
    [7909] = {4, 'Crunch.'}, -- walnut
    [7910] = {4, 'Crunch.'}, -- peanut
    [7963] = {60, 'Munch.'}, -- marlin
    [8112] = {9, 'Urgh.'}, -- scarab cheese
    [8838] = {10, 'Gulp.'}, -- potato
    [8839] = {5, 'Yum.'}, -- plum
    [8840] = {1, 'Yum.'}, -- raspberry
    [8841] = {1, 'Urgh.'}, -- lemon
    [8842] = {7, 'Munch.'}, -- cucumber
    [8843] = {5, 'Crunch.'}, -- onion
    [8844] = {1, 'Gulp.'}, -- jalapeño pepper
    [8845] = {5, 'Munch.'}, -- beetroot
    [8847] = {11, 'Yum.'}, -- chocolate cake
    [9005] = {7, 'Slurp.'}, -- yummy gummy worm
    [9114] = {5, 'Crunch.'}, -- bulb of garlic
    [9996] = {0, 'Slurp.'}, -- banana chocolate shake
    [10454] = {0, 'Your head begins to feel better.'}, -- headache pill
    [11246] = {15, 'Yum.'}, -- rice ball
    [11370] = {3, 'Urgh.'}, -- terramite eggs
    [11429] = {10, 'Mmmm.'}, -- crocodile steak
    [12415] = {20, 'Yum.'}, -- pineapple
    [12416] = {10, 'Munch.'}, -- aubergine
    [12417] = {8, 'Crunch.'}, -- broccoli
    [12418] = {9, 'Crunch.'}, -- cauliflower
    [12637] = {55, 'Gulp.'}, -- ectoplasmic sushi
    [12638] = {18, 'Yum.'}, -- dragonfruit
    [12639] = {2, 'Munch.'}, -- peas
    [13297] = {20, 'Crunch.'}, -- haunch of boar
    [15405] = {55, 'Munch.'}, -- sandfish
    [15487] = {14, 'Urgh.'}, -- larvae
    [15488] = {15, 'Munch.'}, -- deepling filet
    [16014] = {60, 'Mmmm.'}, -- anniversary cake
    [18305] = {0, 'Gulp!'}, -- fresh mushroom beer
    [18306] = {0, 'Phew!'}, -- stale mushroom beer
    [18397] = {33, 'Munch.'}, -- mushroom pie
    [19737] = {10, 'Urgh.'}, -- insectoid eggs
    [20100] = {15, 'Smack.'}, -- soft cheese
    [20101] = {12, 'Smack.'} -- rat cheese
}

function onUse(cid, item, frompos, item2, topos)
    local food = foods[item.itemid]
    if not food then
        return false
    end

    if((getPlayerFood(cid) + food[1]) >= 2000) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are full.')
        return true
    end

    doPlayerFeed(cid, food[1]*12)
    doCreatureSay(cid, food[2], TALKTYPE_MONSTER_SAY)
    doRemoveItem(item.uid, 1)
    return true
end

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 1
local config = {
	storage = 10000, --use empty storage
	exhaust = 1800 --Exhaust is in seconds 600 equals 10min
}

local foods = {
    [2328] = {6, 'Gulp.'}, -- egg
    [2362] = {5, 'Crunch.'}, -- carrot
    [2666] = {15, 'Munch.'}, -- meat
    [2667] = {12, 'Munch.'}, -- fish
    [2668] = {10, 'Mmmm.'}, -- salmon
    [2669] = {17, 'Munch.'}, -- northern pike
    [2670] = {4, 'Gulp.'}, -- shrimp
    [2671] = {30, 'Chomp.'}, -- ham
    [2672] = {60, 'Chomp.'}, -- dragon ham
    [2673] = {5, 'Yum.'}, -- pear
    [2674] = {6, 'Yum.'}, -- red apple
    [2675] = {13, 'Yum.'}, -- orange
    [2676] = {8, 'Yum.'}, -- banana
    [2677] = {1, 'Yum.'}, -- blueberry
    [2678] = {18, 'Slurp.'}, -- coconut
    [2679] = {1, 'Yum.'}, -- cherry
    [2680] = {2, 'Yum.'}, -- strawberry
    [2681] = {9, 'Yum.'}, -- grapes
    [2682] = {20, 'Yum.'}, -- melon
    [2683] = {17, 'Munch.'}, -- pumpkin
    [2684] = {5, 'Crunch.'}, -- carrot
    [2685] = {6, 'Munch.'}, -- tomato
    [2686] = {9, 'Crunch.'}, -- corncob
    [2687] = {2, 'Crunch.'}, -- cookie
    [2688] = {2, 'Munch.'}, -- candy cane
    [2689] = {10, 'Crunch.'}, -- bread
    [2690] = {3, 'Crunch.'}, -- roll
    [2691] = {8, 'Crunch.'}, -- brown bread
    [2696] = {9, 'Smack.'}, -- cheese
    [2787] = {9, 'Munch.'}, -- white mushroom
    [2788] = {4, 'Munch.'}, -- red mushroom
    [2789] = {22, 'Munch.'}, -- brown mushroom
    [2790] = {30, 'Munch.'}, -- orange mushroom
    [2791] = {9, 'Munch.'}, -- wood mushroom
    [2792] = {6, 'Munch.'}, -- dark mushroom
    [2793] = {12, 'Munch.'}, -- some mushrooms
    [2794] = {3, 'Munch.'}, -- some mushrooms
    [2795] = {36, 'Munch.'}, -- fire mushroom
    [2796] = {5, 'Munch.'}, -- green mushroom
    [5097] = {4, 'Yum.'}, -- mango
    [6125] = {8, 'Gulp.'}, -- tortoise egg
    [6278] = {10, 'Mmmm.'}, -- cake
    [6279] = {15, 'Mmmm.'}, -- decorated cake
    [6393] = {12, 'Mmmm.'}, -- valentine's cake
    [6394] = {15, 'Mmmm.'}, -- cream cake
    [6501] = {20, 'Mmmm.'}, -- gingerbread man
    [6541] = {6, 'Gulp.'}, -- coloured egg (yellow)
    [6542] = {6, 'Gulp.'}, -- coloured egg (red)
    [6543] = {6, 'Gulp.'}, -- coloured egg (blue)
    [6544] = {6, 'Gulp.'}, -- coloured egg (green)
    [6545] = {6, 'Gulp.'}, -- coloured egg (purple)
    [6569] = {1, 'Mmmm.'}, -- candy
    [6574] = {5, 'Mmmm.'}, -- bar of chocolate
    [7158] = {15, 'Munch.'}, -- rainbow trout
    [7159] = {13, 'Munch.'}, -- green perch
    [7372] = {2, 'Yum.'}, -- ice cream cone (crispy chocolate chips)
    [7373] = {2, 'Yum.'}, -- ice cream cone (velvet vanilla)
    [7374] = {2, 'Yum.'}, -- ice cream cone (sweet strawberry)
    [7375] = {2, 'Yum.'}, -- ice cream cone (chilly cherry)
    [7376] = {2, 'Yum.'}, -- ice cream cone (mellow melon)
    [7377] = {2, 'Yum.'}, -- ice cream cone (blue-barian)
    [7909] = {4, 'Crunch.'}, -- walnut
    [7910] = {4, 'Crunch.'}, -- peanut
    [7963] = {60, 'Munch.'}, -- marlin
    [8112] = {9, 'Urgh.'}, -- scarab cheese
    [8838] = {10, 'Gulp.'}, -- potato
    [8839] = {5, 'Yum.'}, -- plum
    [8840] = {1, 'Yum.'}, -- raspberry
    [8841] = {1, 'Urgh.'}, -- lemon
    [8842] = {7, 'Munch.'}, -- cucumber
    [8843] = {5, 'Crunch.'}, -- onion
    [8844] = {1, 'Gulp.'}, -- jalapeño pepper
    [8845] = {5, 'Munch.'}, -- beetroot
    [8847] = {11, 'Yum.'}, -- chocolate cake
    [9005] = {7, 'Slurp.'}, -- yummy gummy worm
    [9114] = {5, 'Crunch.'}, -- bulb of garlic
    [9996] = {0, 'Slurp.'}, -- banana chocolate shake
    [10454] = {0, 'Your head begins to feel better.'}, -- headache pill
    [11246] = {15, 'Yum.'}, -- rice ball
    [11370] = {3, 'Urgh.'}, -- terramite eggs
    [11429] = {10, 'Mmmm.'}, -- crocodile steak
    [12415] = {20, 'Yum.'}, -- pineapple
    [12416] = {10, 'Munch.'}, -- aubergine
    [12417] = {8, 'Crunch.'}, -- broccoli
    [12418] = {9, 'Crunch.'}, -- cauliflower
    [12637] = {55, 'Gulp.'}, -- ectoplasmic sushi
    [12638] = {18, 'Yum.'}, -- dragonfruit
    [12639] = {2, 'Munch.'}, -- peas
    [13297] = {20, 'Crunch.'}, -- haunch of boar
    [15405] = {55, 'Munch.'}, -- sandfish
    [15487] = {14, 'Urgh.'}, -- larvae
    [15488] = {15, 'Munch.'}, -- deepling filet
    [16014] = {60, 'Mmmm.'}, -- anniversary cake
    [18305] = {0, 'Gulp!'}, -- fresh mushroom beer
    [18306] = {0, 'Phew!'}, -- stale mushroom beer
    [18397] = {33, 'Munch.'}, -- mushroom pie
    [19737] = {10, 'Urgh.'}, -- insectoid eggs
    [20100] = {15, 'Smack.'}, -- soft cheese
    [20101] = {12, 'Smack.'} -- rat cheese
}

function onUse(cid, item, frompos, item2, topos)
	local food = foods[item.itemid]
	if not food then
		return false
	end
	if((getPlayerFood(cid) + food[1]) >= 2000) then
		return doPlayerSendCancel(cid, "You are full.")
	elseif exhaustion.check(cid,config.storage) then
		return doPlayerSendCancel(cid, "Wait "..exhaustion.get(cid,storage).." seconds.")
	end

	doPlayerFeed(cid, food[1]*12)
	doCreatureSay(cid, food[2], TALKTYPE_MONSTER_SAY)
	doRemoveItem(item.uid, 1)
	exhaustion.set(cid,config.storage,config.exhaust)
	return true
end

 

Edited by Crypter

Share this post


Link to post
Share on other sites
  • 0
3 horas atrás, Naruse disse:

Teste

 

local foods = {
    [2328] = {6, 'Gulp.'}, -- egg
    [2362] = {5, 'Crunch.'}, -- carrot
    [2666] = {15, 'Munch.'}, -- meat
    [2667] = {12, 'Munch.'}, -- fish
    [2668] = {10, 'Mmmm.'}, -- salmon
    [2669] = {17, 'Munch.'}, -- northern pike
    [2670] = {4, 'Gulp.'}, -- shrimp
    [2671] = {30, 'Chomp.'}, -- ham
    [2672] = {60, 'Chomp.'}, -- dragon ham
    [2673] = {5, 'Yum.'}, -- pear
    [2674] = {6, 'Yum.'}, -- red apple
    [2675] = {13, 'Yum.'}, -- orange
    [2676] = {8, 'Yum.'}, -- banana
    [2677] = {1, 'Yum.'}, -- blueberry
    [2678] = {18, 'Slurp.'}, -- coconut
    [2679] = {1, 'Yum.'}, -- cherry
    [2680] = {2, 'Yum.'}, -- strawberry
    [2681] = {9, 'Yum.'}, -- grapes
    [2682] = {20, 'Yum.'}, -- melon
    [2683] = {17, 'Munch.'}, -- pumpkin
    [2684] = {5, 'Crunch.'}, -- carrot
    [2685] = {6, 'Munch.'}, -- tomato
    [2686] = {9, 'Crunch.'}, -- corncob
    [2687] = {2, 'Crunch.'}, -- cookie
    [2688] = {2, 'Munch.'}, -- candy cane
    [2689] = {10, 'Crunch.'}, -- bread
    [2690] = {3, 'Crunch.'}, -- roll
    [2691] = {8, 'Crunch.'}, -- brown bread
    [2696] = {9, 'Smack.'}, -- cheese
    [2787] = {9, 'Munch.'}, -- white mushroom
    [2788] = {4, 'Munch.'}, -- red mushroom
    [2789] = {22, 'Munch.'}, -- brown mushroom
    [2790] = {30, 'Munch.'}, -- orange mushroom
    [2791] = {9, 'Munch.'}, -- wood mushroom
    [2792] = {6, 'Munch.'}, -- dark mushroom
    [2793] = {12, 'Munch.'}, -- some mushrooms
    [2794] = {3, 'Munch.'}, -- some mushrooms
    [2795] = {36, 'Munch.'}, -- fire mushroom
    [2796] = {5, 'Munch.'}, -- green mushroom
    [5097] = {4, 'Yum.'}, -- mango
    [6125] = {8, 'Gulp.'}, -- tortoise egg
    [6278] = {10, 'Mmmm.'}, -- cake
    [6279] = {15, 'Mmmm.'}, -- decorated cake
    [6393] = {12, 'Mmmm.'}, -- valentine's cake
    [6394] = {15, 'Mmmm.'}, -- cream cake
    [6501] = {20, 'Mmmm.'}, -- gingerbread man
    [6541] = {6, 'Gulp.'}, -- coloured egg (yellow)
    [6542] = {6, 'Gulp.'}, -- coloured egg (red)
    [6543] = {6, 'Gulp.'}, -- coloured egg (blue)
    [6544] = {6, 'Gulp.'}, -- coloured egg (green)
    [6545] = {6, 'Gulp.'}, -- coloured egg (purple)
    [6569] = {1, 'Mmmm.'}, -- candy
    [6574] = {5, 'Mmmm.'}, -- bar of chocolate
    [7158] = {15, 'Munch.'}, -- rainbow trout
    [7159] = {13, 'Munch.'}, -- green perch
    [7372] = {2, 'Yum.'}, -- ice cream cone (crispy chocolate chips)
    [7373] = {2, 'Yum.'}, -- ice cream cone (velvet vanilla)
    [7374] = {2, 'Yum.'}, -- ice cream cone (sweet strawberry)
    [7375] = {2, 'Yum.'}, -- ice cream cone (chilly cherry)
    [7376] = {2, 'Yum.'}, -- ice cream cone (mellow melon)
    [7377] = {2, 'Yum.'}, -- ice cream cone (blue-barian)
    [7909] = {4, 'Crunch.'}, -- walnut
    [7910] = {4, 'Crunch.'}, -- peanut
    [7963] = {60, 'Munch.'}, -- marlin
    [8112] = {9, 'Urgh.'}, -- scarab cheese
    [8838] = {10, 'Gulp.'}, -- potato
    [8839] = {5, 'Yum.'}, -- plum
    [8840] = {1, 'Yum.'}, -- raspberry
    [8841] = {1, 'Urgh.'}, -- lemon
    [8842] = {7, 'Munch.'}, -- cucumber
    [8843] = {5, 'Crunch.'}, -- onion
    [8844] = {1, 'Gulp.'}, -- jalapeño pepper
    [8845] = {5, 'Munch.'}, -- beetroot
    [8847] = {11, 'Yum.'}, -- chocolate cake
    [9005] = {7, 'Slurp.'}, -- yummy gummy worm
    [9114] = {5, 'Crunch.'}, -- bulb of garlic
    [9996] = {0, 'Slurp.'}, -- banana chocolate shake
    [10454] = {0, 'Your head begins to feel better.'}, -- headache pill
    [11246] = {15, 'Yum.'}, -- rice ball
    [11370] = {3, 'Urgh.'}, -- terramite eggs
    [11429] = {10, 'Mmmm.'}, -- crocodile steak
    [12415] = {20, 'Yum.'}, -- pineapple
    [12416] = {10, 'Munch.'}, -- aubergine
    [12417] = {8, 'Crunch.'}, -- broccoli
    [12418] = {9, 'Crunch.'}, -- cauliflower
    [12637] = {55, 'Gulp.'}, -- ectoplasmic sushi
    [12638] = {18, 'Yum.'}, -- dragonfruit
    [12639] = {2, 'Munch.'}, -- peas
    [13297] = {20, 'Crunch.'}, -- haunch of boar
    [15405] = {55, 'Munch.'}, -- sandfish
    [15487] = {14, 'Urgh.'}, -- larvae
    [15488] = {15, 'Munch.'}, -- deepling filet
    [16014] = {60, 'Mmmm.'}, -- anniversary cake
    [18305] = {0, 'Gulp!'}, -- fresh mushroom beer
    [18306] = {0, 'Phew!'}, -- stale mushroom beer
    [18397] = {33, 'Munch.'}, -- mushroom pie
    [19737] = {10, 'Urgh.'}, -- insectoid eggs
    [20100] = {15, 'Smack.'}, -- soft cheese
    [20101] = {12, 'Smack.'} -- rat cheese
}

function onUse(cid, item, frompos, item2, topos)
    local food = foods[item.itemid]
    if not food then
        return false
    end
  
  local config = {
    storage = 10000, --use empty storage
    exhaust = 1800 --Exhaust is in seconds 600 equals 10min
}

    if((getPlayerFood(cid) + food[1]) >= 2000) then
        if exhaustion.check(cid,config.storage) then
        doPlayerSendCancel(cid, "You are full.")
        return true
    end

    doPlayerFeed(cid, food[1]*12)
    doCreatureSay(cid, food[2], TALKTYPE_MONSTER_SAY)
    doRemoveItem(item.uid, 1)
    exhaustion.set(cid,config.storage,config.exhaust)
    return true
end

 

[7/9/2018 22:21:49] data/actions/scripts/other/food.lua:125: 'end' expected (to close 'function' at line 103) near '<eof>'
[7/9/2018 22:21:49] [Error - LuaInterface::loadFile] data/actions/scripts/other/food.lua:125: 'end' expected (to close 'function' at line 103) near '<eof>'
[7/9/2018 22:21:49] [Error - Event::checkScript] Cannot load script (data/actions/scripts/other/food.lua)
[7/9/2018 22:21:49] data/actions/scripts/other/food.lua:125: 'end' expected (to close 'function' at line 103) near '<eof>'

Share this post


Link to post
Share on other sites
  • 0
17 minutos atrás, Naruse disse:
local foods = {
    [2328] = {6, 'Gulp.'}, -- egg
    [2362] = {5, 'Crunch.'}, -- carrot
    [2666] = {15, 'Munch.'}, -- meat
    [2667] = {12, 'Munch.'}, -- fish
    [2668] = {10, 'Mmmm.'}, -- salmon
    [2669] = {17, 'Munch.'}, -- northern pike
    [2670] = {4, 'Gulp.'}, -- shrimp
    [2671] = {30, 'Chomp.'}, -- ham
    [2672] = {60, 'Chomp.'}, -- dragon ham
    [2673] = {5, 'Yum.'}, -- pear
    [2674] = {6, 'Yum.'}, -- red apple
    [2675] = {13, 'Yum.'}, -- orange
    [2676] = {8, 'Yum.'}, -- banana
    [2677] = {1, 'Yum.'}, -- blueberry
    [2678] = {18, 'Slurp.'}, -- coconut
    [2679] = {1, 'Yum.'}, -- cherry
    [2680] = {2, 'Yum.'}, -- strawberry
    [2681] = {9, 'Yum.'}, -- grapes
    [2682] = {20, 'Yum.'}, -- melon
    [2683] = {17, 'Munch.'}, -- pumpkin
    [2684] = {5, 'Crunch.'}, -- carrot
    [2685] = {6, 'Munch.'}, -- tomato
    [2686] = {9, 'Crunch.'}, -- corncob
    [2687] = {2, 'Crunch.'}, -- cookie
    [2688] = {2, 'Munch.'}, -- candy cane
    [2689] = {10, 'Crunch.'}, -- bread
    [2690] = {3, 'Crunch.'}, -- roll
    [2691] = {8, 'Crunch.'}, -- brown bread
    [2696] = {9, 'Smack.'}, -- cheese
    [2787] = {9, 'Munch.'}, -- white mushroom
    [2788] = {4, 'Munch.'}, -- red mushroom
    [2789] = {22, 'Munch.'}, -- brown mushroom
    [2790] = {30, 'Munch.'}, -- orange mushroom
    [2791] = {9, 'Munch.'}, -- wood mushroom
    [2792] = {6, 'Munch.'}, -- dark mushroom
    [2793] = {12, 'Munch.'}, -- some mushrooms
    [2794] = {3, 'Munch.'}, -- some mushrooms
    [2795] = {36, 'Munch.'}, -- fire mushroom
    [2796] = {5, 'Munch.'}, -- green mushroom
    [5097] = {4, 'Yum.'}, -- mango
    [6125] = {8, 'Gulp.'}, -- tortoise egg
    [6278] = {10, 'Mmmm.'}, -- cake
    [6279] = {15, 'Mmmm.'}, -- decorated cake
    [6393] = {12, 'Mmmm.'}, -- valentine's cake
    [6394] = {15, 'Mmmm.'}, -- cream cake
    [6501] = {20, 'Mmmm.'}, -- gingerbread man
    [6541] = {6, 'Gulp.'}, -- coloured egg (yellow)
    [6542] = {6, 'Gulp.'}, -- coloured egg (red)
    [6543] = {6, 'Gulp.'}, -- coloured egg (blue)
    [6544] = {6, 'Gulp.'}, -- coloured egg (green)
    [6545] = {6, 'Gulp.'}, -- coloured egg (purple)
    [6569] = {1, 'Mmmm.'}, -- candy
    [6574] = {5, 'Mmmm.'}, -- bar of chocolate
    [7158] = {15, 'Munch.'}, -- rainbow trout
    [7159] = {13, 'Munch.'}, -- green perch
    [7372] = {2, 'Yum.'}, -- ice cream cone (crispy chocolate chips)
    [7373] = {2, 'Yum.'}, -- ice cream cone (velvet vanilla)
    [7374] = {2, 'Yum.'}, -- ice cream cone (sweet strawberry)
    [7375] = {2, 'Yum.'}, -- ice cream cone (chilly cherry)
    [7376] = {2, 'Yum.'}, -- ice cream cone (mellow melon)
    [7377] = {2, 'Yum.'}, -- ice cream cone (blue-barian)
    [7909] = {4, 'Crunch.'}, -- walnut
    [7910] = {4, 'Crunch.'}, -- peanut
    [7963] = {60, 'Munch.'}, -- marlin
    [8112] = {9, 'Urgh.'}, -- scarab cheese
    [8838] = {10, 'Gulp.'}, -- potato
    [8839] = {5, 'Yum.'}, -- plum
    [8840] = {1, 'Yum.'}, -- raspberry
    [8841] = {1, 'Urgh.'}, -- lemon
    [8842] = {7, 'Munch.'}, -- cucumber
    [8843] = {5, 'Crunch.'}, -- onion
    [8844] = {1, 'Gulp.'}, -- jalapeño pepper
    [8845] = {5, 'Munch.'}, -- beetroot
    [8847] = {11, 'Yum.'}, -- chocolate cake
    [9005] = {7, 'Slurp.'}, -- yummy gummy worm
    [9114] = {5, 'Crunch.'}, -- bulb of garlic
    [9996] = {0, 'Slurp.'}, -- banana chocolate shake
    [10454] = {0, 'Your head begins to feel better.'}, -- headache pill
    [11246] = {15, 'Yum.'}, -- rice ball
    [11370] = {3, 'Urgh.'}, -- terramite eggs
    [11429] = {10, 'Mmmm.'}, -- crocodile steak
    [12415] = {20, 'Yum.'}, -- pineapple
    [12416] = {10, 'Munch.'}, -- aubergine
    [12417] = {8, 'Crunch.'}, -- broccoli
    [12418] = {9, 'Crunch.'}, -- cauliflower
    [12637] = {55, 'Gulp.'}, -- ectoplasmic sushi
    [12638] = {18, 'Yum.'}, -- dragonfruit
    [12639] = {2, 'Munch.'}, -- peas
    [13297] = {20, 'Crunch.'}, -- haunch of boar
    [15405] = {55, 'Munch.'}, -- sandfish
    [15487] = {14, 'Urgh.'}, -- larvae
    [15488] = {15, 'Munch.'}, -- deepling filet
    [16014] = {60, 'Mmmm.'}, -- anniversary cake
    [18305] = {0, 'Gulp!'}, -- fresh mushroom beer
    [18306] = {0, 'Phew!'}, -- stale mushroom beer
    [18397] = {33, 'Munch.'}, -- mushroom pie
    [19737] = {10, 'Urgh.'}, -- insectoid eggs
    [20100] = {15, 'Smack.'}, -- soft cheese
    [20101] = {12, 'Smack.'} -- rat cheese
}

function onUse(cid, item, frompos, item2, topos)
    local food = foods[item.itemid]
    if not food then
        return false
    end
  
  local config = {
    storage = 10000, --use empty storage
    exhaust = 1800 --Exhaust is in seconds 600 equals 10min
}

    if((getPlayerFood(cid) + food[1]) >= 2000) then
        if exhaustion.check(cid,config.storage) then
        doPlayerSendCancel(cid, "You are full.")

    doPlayerFeed(cid, food[1]*12)
    doCreatureSay(cid, food[2], TALKTYPE_MONSTER_SAY)
    doRemoveItem(item.uid, 1)
    exhaustion.set(cid,config.storage,config.exhaust)
    return true
end

 

[8/9/2018 9:53:37] [Error - Event::checkScript] Cannot load script (data/actions/scripts/other/food.lua)
[8/9/2018 9:53:37] data/actions/scripts/other/food.lua:123: 'end' expected (to close 'if' at line 114) near '<eof>'

Share this post


Link to post
Share on other sites
  • 0
3 horas atrás, Naruse disse:

Escreve denovo o end da ultima linha pra ve

continuando dando o mesmo erro agora em outra linha ! , acho que resolve se refazer o scprit

Share this post


Link to post
Share on other sites
  • 0
10 horas atrás, Crypter disse:
local config = {
	storage = 10000, --use empty storage
	exhaust = 1800 --Exhaust is in seconds 600 equals 10min
}

local foods = {
    [2328] = {6, 'Gulp.'}, -- egg
    [2362] = {5, 'Crunch.'}, -- carrot
    [2666] = {15, 'Munch.'}, -- meat
    [2667] = {12, 'Munch.'}, -- fish
    [2668] = {10, 'Mmmm.'}, -- salmon
    [2669] = {17, 'Munch.'}, -- northern pike
    [2670] = {4, 'Gulp.'}, -- shrimp
    [2671] = {30, 'Chomp.'}, -- ham
    [2672] = {60, 'Chomp.'}, -- dragon ham
    [2673] = {5, 'Yum.'}, -- pear
    [2674] = {6, 'Yum.'}, -- red apple
    [2675] = {13, 'Yum.'}, -- orange
    [2676] = {8, 'Yum.'}, -- banana
    [2677] = {1, 'Yum.'}, -- blueberry
    [2678] = {18, 'Slurp.'}, -- coconut
    [2679] = {1, 'Yum.'}, -- cherry
    [2680] = {2, 'Yum.'}, -- strawberry
    [2681] = {9, 'Yum.'}, -- grapes
    [2682] = {20, 'Yum.'}, -- melon
    [2683] = {17, 'Munch.'}, -- pumpkin
    [2684] = {5, 'Crunch.'}, -- carrot
    [2685] = {6, 'Munch.'}, -- tomato
    [2686] = {9, 'Crunch.'}, -- corncob
    [2687] = {2, 'Crunch.'}, -- cookie
    [2688] = {2, 'Munch.'}, -- candy cane
    [2689] = {10, 'Crunch.'}, -- bread
    [2690] = {3, 'Crunch.'}, -- roll
    [2691] = {8, 'Crunch.'}, -- brown bread
    [2696] = {9, 'Smack.'}, -- cheese
    [2787] = {9, 'Munch.'}, -- white mushroom
    [2788] = {4, 'Munch.'}, -- red mushroom
    [2789] = {22, 'Munch.'}, -- brown mushroom
    [2790] = {30, 'Munch.'}, -- orange mushroom
    [2791] = {9, 'Munch.'}, -- wood mushroom
    [2792] = {6, 'Munch.'}, -- dark mushroom
    [2793] = {12, 'Munch.'}, -- some mushrooms
    [2794] = {3, 'Munch.'}, -- some mushrooms
    [2795] = {36, 'Munch.'}, -- fire mushroom
    [2796] = {5, 'Munch.'}, -- green mushroom
    [5097] = {4, 'Yum.'}, -- mango
    [6125] = {8, 'Gulp.'}, -- tortoise egg
    [6278] = {10, 'Mmmm.'}, -- cake
    [6279] = {15, 'Mmmm.'}, -- decorated cake
    [6393] = {12, 'Mmmm.'}, -- valentine's cake
    [6394] = {15, 'Mmmm.'}, -- cream cake
    [6501] = {20, 'Mmmm.'}, -- gingerbread man
    [6541] = {6, 'Gulp.'}, -- coloured egg (yellow)
    [6542] = {6, 'Gulp.'}, -- coloured egg (red)
    [6543] = {6, 'Gulp.'}, -- coloured egg (blue)
    [6544] = {6, 'Gulp.'}, -- coloured egg (green)
    [6545] = {6, 'Gulp.'}, -- coloured egg (purple)
    [6569] = {1, 'Mmmm.'}, -- candy
    [6574] = {5, 'Mmmm.'}, -- bar of chocolate
    [7158] = {15, 'Munch.'}, -- rainbow trout
    [7159] = {13, 'Munch.'}, -- green perch
    [7372] = {2, 'Yum.'}, -- ice cream cone (crispy chocolate chips)
    [7373] = {2, 'Yum.'}, -- ice cream cone (velvet vanilla)
    [7374] = {2, 'Yum.'}, -- ice cream cone (sweet strawberry)
    [7375] = {2, 'Yum.'}, -- ice cream cone (chilly cherry)
    [7376] = {2, 'Yum.'}, -- ice cream cone (mellow melon)
    [7377] = {2, 'Yum.'}, -- ice cream cone (blue-barian)
    [7909] = {4, 'Crunch.'}, -- walnut
    [7910] = {4, 'Crunch.'}, -- peanut
    [7963] = {60, 'Munch.'}, -- marlin
    [8112] = {9, 'Urgh.'}, -- scarab cheese
    [8838] = {10, 'Gulp.'}, -- potato
    [8839] = {5, 'Yum.'}, -- plum
    [8840] = {1, 'Yum.'}, -- raspberry
    [8841] = {1, 'Urgh.'}, -- lemon
    [8842] = {7, 'Munch.'}, -- cucumber
    [8843] = {5, 'Crunch.'}, -- onion
    [8844] = {1, 'Gulp.'}, -- jalapeño pepper
    [8845] = {5, 'Munch.'}, -- beetroot
    [8847] = {11, 'Yum.'}, -- chocolate cake
    [9005] = {7, 'Slurp.'}, -- yummy gummy worm
    [9114] = {5, 'Crunch.'}, -- bulb of garlic
    [9996] = {0, 'Slurp.'}, -- banana chocolate shake
    [10454] = {0, 'Your head begins to feel better.'}, -- headache pill
    [11246] = {15, 'Yum.'}, -- rice ball
    [11370] = {3, 'Urgh.'}, -- terramite eggs
    [11429] = {10, 'Mmmm.'}, -- crocodile steak
    [12415] = {20, 'Yum.'}, -- pineapple
    [12416] = {10, 'Munch.'}, -- aubergine
    [12417] = {8, 'Crunch.'}, -- broccoli
    [12418] = {9, 'Crunch.'}, -- cauliflower
    [12637] = {55, 'Gulp.'}, -- ectoplasmic sushi
    [12638] = {18, 'Yum.'}, -- dragonfruit
    [12639] = {2, 'Munch.'}, -- peas
    [13297] = {20, 'Crunch.'}, -- haunch of boar
    [15405] = {55, 'Munch.'}, -- sandfish
    [15487] = {14, 'Urgh.'}, -- larvae
    [15488] = {15, 'Munch.'}, -- deepling filet
    [16014] = {60, 'Mmmm.'}, -- anniversary cake
    [18305] = {0, 'Gulp!'}, -- fresh mushroom beer
    [18306] = {0, 'Phew!'}, -- stale mushroom beer
    [18397] = {33, 'Munch.'}, -- mushroom pie
    [19737] = {10, 'Urgh.'}, -- insectoid eggs
    [20100] = {15, 'Smack.'}, -- soft cheese
    [20101] = {12, 'Smack.'} -- rat cheese
}

function onUse(cid, item, frompos, item2, topos)
	local food = foods[item.itemid]
	if not food then
		return false
	end
	if((getPlayerFood(cid) + food[1]) >= 2000) then
		return doPlayerSendCancel(cid, "You are full.")
	elseif exhaustion.check(cid,config.storage) then
		return doPlayerSendCancel(cid, "Wait "..exhaustion.get(cid,storage).." seconds.")
	end

	doPlayerFeed(cid, food[1]*12)
	doCreatureSay(cid, food[2], TALKTYPE_MONSTER_SAY)
	doRemoveItem(item.uid, 1)
	exhaustion.set(cid,config.storage,config.exhaust)
	return true
end

funfo de boa aqui ! so que nao ta executando o tempo da exaustão 

tenta colocar essas função que funciona aqui nesse tf.

 

function onUse(cid, item, fromPos, itemEx, toPos)
    if (getPlayerStorageValue(cid, config.storage) <= os.time()) then
    doAddCondition(cid, condition)
    doCreatureSay(cid, "Munch.",TALKTYPE_ORANGE_1)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You're real fast for 1 hour.")
    doRemoveItem(item.uid, 1)
    setPlayerStorageValue(cid, config.storage, os.time() + config.exhaust)
       else
    doPlayerSendCancel(cid, "You are full.")
    end
return true
end

Edited by Emooooo

Share this post


Link to post
Share on other sites
  • 0
11 minutos atrás, Naruse disse:

Que linha deu erro?!

da uma olhada no scrpit do cara la embaixo deu certo , só que não executou a exaustão .

Share this post


Link to post
Share on other sites
  • 0
local tempo = 5

local FOODS =
{
	[2362] = {8, "Crunch."},
	[2666] = {15, "Munch."},
	[2667] = {12, "Munch."},
	[2668] = {10, "Mmmm."},
	[2669] = {17, "Munch."},
	[2670] = {4, "Gulp."},
	[2671] = {30, "Chomp."},
	[2672] = {60, "Chomp."},
	[2673] = {5, "Yum."},
	[2674] = {6, "Yum."},
	[2675] = {13, "Yum."},
	[2676] = {8, "Yum."},
	[2677] = {1, "Yum."},
	[2678] = {18, "Slurp."},
	[2679] = {1, "Yum."},
	[2680] = {2, "Yum."},
	[2681] = {9, "Yum."},
	[2682] = {20, "Yum."},
	[2683] = {17, "Munch."},
	[2684] = {8, "Crunch."},
	[2685] = {6, "Munch."},
	[2686] = {9, "Crunch."},
	[2687] = {2, "Crunch."},
	[2688] = {9, "Munch."},
	[2689] = {10, "Crunch."},
	[2690] = {3, "Crunch."},
	[2691] = {8, "Crunch."},
	[2792] = {6, "Munch."},
	[2793] = {9, "Munch."},
	[2695] = {6, "Gulp."},
	[2696] = {9, "Smack."},
	[2787] = {9, "Munch."},
	[2788] = {4, "Munch."},
	[2789] = {22, "Munch."},
	[2790] = {30, "Munch."},
	[2791] = {30, "Munch."},
	[2792] = {6, "Munch."},
	[2794] = {3, "Munch."},
	[2795] = {36, "Munch."},
	[2796] = {5, "Munch."},
	[2793] = {9, "Munch."},
	[5097] = {4, "Yum."},
	[6125] = {8, "Gulp."},
	[6278] = {10, "Mmmm."},
	[6279] = {15, "Mmmm."},
	[6393] = {12, "Mmmm."},
	[6394] = {15, "Mmmm."},
	[6501] = {20, "Mmmm."},
	[6541] = {6, "Gulp."},
	[6542] = {6, "Gulp."},
	[6543] = {6, "Gulp."},
	[6544] = {6, "Gulp."},
	[6545] = {6, "Gulp."},
	[6569] = {1, "Mmmm."},
	[6574] = {4, "Mmmm."},
	[7158] = {15, "Munch."},
	[7159] = {13, "Munch."},
	[7372] = {7, "Yum."},
	[7373] = {7, "Yum."},
	[7374] = {7, "Yum."},
	[7375] = {7, "Yum."},
	[7376] = {7, "Yum."},
	[7377] = {7, "Yum."},
	[7909] = {4, "Crunch."},
	[8838] = {7, "Gulp."},
	[8839] = {5, "Yum."},
	[8840] = {2, "Yum."},
	[8841] = {3, "Urgh."},
	[8842] = {3, "Munch."},
	[8843] = {3, "Crunch."},
	[8844] = {3, "Gulp."},
	[8845] = {2, "Munch."},
	[8847] = {11, "Yum."}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if (getPlayerStorageValue(cid, 787878) >= os.time()) then
return doPlayerSendCancel(cid, "Espere por"..tempo.."segundos para comer.")
end

	local food = FOODS[item.itemid]
	if(not food) then
		return false
	end

	if((getPlayerFood(cid) + food[1]) >= 4000) then
		doPlayerSendCancel(cid, "You are full.")
		return true
	end

	doPlayerFeed(cid, food[1] * 4)
	doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
	doRemoveItem(item.uid, 1)
	setPlayerStorageValue(cid, 787878, os.time()+tempo)
	return true
end

 

Share this post


Link to post
Share on other sites
  • 0
5 horas atrás, Pinpao disse:
local tempo = 5

local FOODS =
{
	[2362] = {8, "Crunch."},
	[2666] = {15, "Munch."},
	[2667] = {12, "Munch."},
	[2668] = {10, "Mmmm."},
	[2669] = {17, "Munch."},
	[2670] = {4, "Gulp."},
	[2671] = {30, "Chomp."},
	[2672] = {60, "Chomp."},
	[2673] = {5, "Yum."},
	[2674] = {6, "Yum."},
	[2675] = {13, "Yum."},
	[2676] = {8, "Yum."},
	[2677] = {1, "Yum."},
	[2678] = {18, "Slurp."},
	[2679] = {1, "Yum."},
	[2680] = {2, "Yum."},
	[2681] = {9, "Yum."},
	[2682] = {20, "Yum."},
	[2683] = {17, "Munch."},
	[2684] = {8, "Crunch."},
	[2685] = {6, "Munch."},
	[2686] = {9, "Crunch."},
	[2687] = {2, "Crunch."},
	[2688] = {9, "Munch."},
	[2689] = {10, "Crunch."},
	[2690] = {3, "Crunch."},
	[2691] = {8, "Crunch."},
	[2792] = {6, "Munch."},
	[2793] = {9, "Munch."},
	[2695] = {6, "Gulp."},
	[2696] = {9, "Smack."},
	[2787] = {9, "Munch."},
	[2788] = {4, "Munch."},
	[2789] = {22, "Munch."},
	[2790] = {30, "Munch."},
	[2791] = {30, "Munch."},
	[2792] = {6, "Munch."},
	[2794] = {3, "Munch."},
	[2795] = {36, "Munch."},
	[2796] = {5, "Munch."},
	[2793] = {9, "Munch."},
	[5097] = {4, "Yum."},
	[6125] = {8, "Gulp."},
	[6278] = {10, "Mmmm."},
	[6279] = {15, "Mmmm."},
	[6393] = {12, "Mmmm."},
	[6394] = {15, "Mmmm."},
	[6501] = {20, "Mmmm."},
	[6541] = {6, "Gulp."},
	[6542] = {6, "Gulp."},
	[6543] = {6, "Gulp."},
	[6544] = {6, "Gulp."},
	[6545] = {6, "Gulp."},
	[6569] = {1, "Mmmm."},
	[6574] = {4, "Mmmm."},
	[7158] = {15, "Munch."},
	[7159] = {13, "Munch."},
	[7372] = {7, "Yum."},
	[7373] = {7, "Yum."},
	[7374] = {7, "Yum."},
	[7375] = {7, "Yum."},
	[7376] = {7, "Yum."},
	[7377] = {7, "Yum."},
	[7909] = {4, "Crunch."},
	[8838] = {7, "Gulp."},
	[8839] = {5, "Yum."},
	[8840] = {2, "Yum."},
	[8841] = {3, "Urgh."},
	[8842] = {3, "Munch."},
	[8843] = {3, "Crunch."},
	[8844] = {3, "Gulp."},
	[8845] = {2, "Munch."},
	[8847] = {11, "Yum."}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if (getPlayerStorageValue(cid, 787878) >= os.time()) then
return doPlayerSendCancel(cid, "Espere por"..tempo.."segundos para comer.")
end

	local food = FOODS[item.itemid]
	if(not food) then
		return false
	end

	if((getPlayerFood(cid) + food[1]) >= 4000) then
		doPlayerSendCancel(cid, "You are full.")
		return true
	end

	doPlayerFeed(cid, food[1] * 4)
	doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
	doRemoveItem(item.uid, 1)
	setPlayerStorageValue(cid, 787878, os.time()+tempo)
	return true
end

 

faltou colocar pra curar , por que ta cumendo o food e nao ta curando

Share this post


Link to post
Share on other sites
  • 0
1 hora atrás, Naruse disse:

Teste 

local tempo = 5

local FOODS =
{
	[2362] = {8, "Crunch."},
	[2666] = {15, "Munch."},
	[2667] = {12, "Munch."},
	[2668] = {10, "Mmmm."},
	[2669] = {17, "Munch."},
	[2670] = {4, "Gulp."},
	[2671] = {30, "Chomp."},
	[2672] = {60, "Chomp."},
	[2673] = {5, "Yum."},
	[2674] = {6, "Yum."},
	[2675] = {13, "Yum."},
	[2676] = {8, "Yum."},
	[2677] = {1, "Yum."},
	[2678] = {18, "Slurp."},
	[2679] = {1, "Yum."},
	[2680] = {2, "Yum."},
	[2681] = {9, "Yum."},
	[2682] = {20, "Yum."},
	[2683] = {17, "Munch."},
	[2684] = {8, "Crunch."},
	[2685] = {6, "Munch."},
	[2686] = {9, "Crunch."},
	[2687] = {2, "Crunch."},
	[2688] = {9, "Munch."},
	[2689] = {10, "Crunch."},
	[2690] = {3, "Crunch."},
	[2691] = {8, "Crunch."},
	[2792] = {6, "Munch."},
	[2793] = {9, "Munch."},
	[2695] = {6, "Gulp."},
	[2696] = {9, "Smack."},
	[2787] = {9, "Munch."},
	[2788] = {4, "Munch."},
	[2789] = {22, "Munch."},
	[2790] = {30, "Munch."},
	[2791] = {30, "Munch."},
	[2792] = {6, "Munch."},
	[2794] = {3, "Munch."},
	[2795] = {36, "Munch."},
	[2796] = {5, "Munch."},
	[2793] = {9, "Munch."},
	[5097] = {4, "Yum."},
	[6125] = {8, "Gulp."},
	[6278] = {10, "Mmmm."},
	[6279] = {15, "Mmmm."},
	[6393] = {12, "Mmmm."},
	[6394] = {15, "Mmmm."},
	[6501] = {20, "Mmmm."},
	[6541] = {6, "Gulp."},
	[6542] = {6, "Gulp."},
	[6543] = {6, "Gulp."},
	[6544] = {6, "Gulp."},
	[6545] = {6, "Gulp."},
	[6569] = {1, "Mmmm."},
	[6574] = {4, "Mmmm."},
	[7158] = {15, "Munch."},
	[7159] = {13, "Munch."},
	[7372] = {7, "Yum."},
	[7373] = {7, "Yum."},
	[7374] = {7, "Yum."},
	[7375] = {7, "Yum."},
	[7376] = {7, "Yum."},
	[7377] = {7, "Yum."},
	[7909] = {4, "Crunch."},
	[8838] = {7, "Gulp."},
	[8839] = {5, "Yum."},
	[8840] = {2, "Yum."},
	[8841] = {3, "Urgh."},
	[8842] = {3, "Munch."},
	[8843] = {3, "Crunch."},
	[8844] = {3, "Gulp."},
	[8845] = {2, "Munch."},
	[8847] = {11, "Yum."}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if (getPlayerStorageValue(cid, 787878) >= os.time()) then
return doPlayerSendCancel(cid, "Espere por"..tempo.."segundos para comer.")
end

	local food = FOODS[item.itemid]
	if(not food) then
		return false
	end

	if((getPlayerFood(cid) + food[1]) >= 4000) then
		doPlayerSendCancel(cid, "You are full.")
		return true
	end

	doPlayerFeed(cid, food[1] * 4)
	doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
	doRemoveItem(item.uid, 1)
    doCureStatus(cid, "all", true)
	setPlayerStorageValue(cid, 787878, os.time()+tempo)
	return true
end

 

[10/9/2018 10:41:6] [Error - Action Interface] 
[10/9/2018 10:41:6] data/actions/scripts/other/food.lua:onUse
[10/9/2018 10:41:6] Description: 
[10/9/2018 10:41:6] data/actions/scripts/other/food.lua:99: attempt to call global 'doCureStatus' (a nil value)
[10/9/2018 10:41:6] stack traceback:
[10/9/2018 10:41:6]     data/actions/scripts/other/food.lua:99: in function <data/actions/scripts/other/food.lua:80>

Share this post


Link to post
Share on other sites
  • 0
Em 10/09/2018 em 18:58, Naruse disse:

Teste

local tempo = 5

local FOODS =
{
	[2362] = {8, "Crunch."},
	[2666] = {15, "Munch."},
	[2667] = {12, "Munch."},
	[2668] = {10, "Mmmm."},
	[2669] = {17, "Munch."},
	[2670] = {4, "Gulp."},
	[2671] = {30, "Chomp."},
	[2672] = {60, "Chomp."},
	[2673] = {5, "Yum."},
	[2674] = {6, "Yum."},
	[2675] = {13, "Yum."},
	[2676] = {8, "Yum."},
	[2677] = {1, "Yum."},
	[2678] = {18, "Slurp."},
	[2679] = {1, "Yum."},
	[2680] = {2, "Yum."},
	[2681] = {9, "Yum."},
	[2682] = {20, "Yum."},
	[2683] = {17, "Munch."},
	[2684] = {8, "Crunch."},
	[2685] = {6, "Munch."},
	[2686] = {9, "Crunch."},
	[2687] = {2, "Crunch."},
	[2688] = {9, "Munch."},
	[2689] = {10, "Crunch."},
	[2690] = {3, "Crunch."},
	[2691] = {8, "Crunch."},
	[2792] = {6, "Munch."},
	[2793] = {9, "Munch."},
	[2695] = {6, "Gulp."},
	[2696] = {9, "Smack."},
	[2787] = {9, "Munch."},
	[2788] = {4, "Munch."},
	[2789] = {22, "Munch."},
	[2790] = {30, "Munch."},
	[2791] = {30, "Munch."},
	[2792] = {6, "Munch."},
	[2794] = {3, "Munch."},
	[2795] = {36, "Munch."},
	[2796] = {5, "Munch."},
	[2793] = {9, "Munch."},
	[5097] = {4, "Yum."},
	[6125] = {8, "Gulp."},
	[6278] = {10, "Mmmm."},
	[6279] = {15, "Mmmm."},
	[6393] = {12, "Mmmm."},
	[6394] = {15, "Mmmm."},
	[6501] = {20, "Mmmm."},
	[6541] = {6, "Gulp."},
	[6542] = {6, "Gulp."},
	[6543] = {6, "Gulp."},
	[6544] = {6, "Gulp."},
	[6545] = {6, "Gulp."},
	[6569] = {1, "Mmmm."},
	[6574] = {4, "Mmmm."},
	[7158] = {15, "Munch."},
	[7159] = {13, "Munch."},
	[7372] = {7, "Yum."},
	[7373] = {7, "Yum."},
	[7374] = {7, "Yum."},
	[7375] = {7, "Yum."},
	[7376] = {7, "Yum."},
	[7377] = {7, "Yum."},
	[7909] = {4, "Crunch."},
	[8838] = {7, "Gulp."},
	[8839] = {5, "Yum."},
	[8840] = {2, "Yum."},
	[8841] = {3, "Urgh."},
	[8842] = {3, "Munch."},
	[8843] = {3, "Crunch."},
	[8844] = {3, "Gulp."},
	[8845] = {2, "Munch."},
	[8847] = {11, "Yum."}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if (getPlayerStorageValue(cid, 787878) >= os.time()) then
return doPlayerSendCancel(cid, "Espere por"..tempo.."segundos para comer.")
end

	local food = FOODS[item.itemid]
	if(not food) then
		return false
	end

	if((getPlayerFood(cid) + food[1]) >= 4000) then
		doPlayerSendCancel(cid, "You are full.")
		return true
	end

	doPlayerFeed(cid, food[1] * 4)
	doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
	doRemoveItem(item.uid, 1)
    doCureStatus(cid, "all", true)
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
	setPlayerStorageValue(cid, 787878, os.time()+tempo)
	return true
end

 

[11/9/2018 20:50:53] [Error - Action Interface] 
[11/9/2018 20:50:53] data/actions/scripts/other/food.lua:onUse
[11/9/2018 20:50:53] Description: 
[11/9/2018 20:50:53] data/actions/scripts/other/food.lua:99: attempt to call global 'doCureStatus' (a nil value)
[11/9/2018 20:50:53] stack traceback:
[11/9/2018 20:50:53]     data/actions/scripts/other/food.lua:99: in function <data/actions/scripts/other/food.lua:80>

Share this post


Link to post
Share on other sites
  • 0
O pedido neste tópico de foi atendido e/ou o autor do tópico resolveu sua duvida. Este tópico está fechado e foi movido para

Please login or register to see this link.

. Se você tiver outros pedidos, crie um novo tópico.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...