Ir para conteúdo
  • 0

colocar storage aqui


Emooooo

Pergunta

colocar storage aqui , para o player comer o food a cada 15 min.

*todos os foods*

e continuar enchendo vida e mana.

+rep

tfs 0.3.6

 

 

 

 

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)
    local food = FOODS[item.itemid]
    if(not food) then
        return false
    end

    if((getPlayerFood(cid) + food[1]) >= 400) 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)
    return true
end

Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

  • 0

@Emooooo

 

Testa ae
 

Spoiler



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)
local waittime = 900
local storage = 100002

if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, "System", "Aguarde ".. exhaustion.get(cid, storage) .. " segundos para comer novamente.", MESSAGE_EVENT_ADVANCE)
return false
end
    local food = FOODS[item.itemid]
    if(not food) then
        return false
    end

    if((getPlayerFood(cid) + food[1]) >= 400) 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)
	exhaustion.set(cid, storage, waittime)
    return true
end


 

 

Link para o comentário
Compartilhar em outros sites

  • 0
3 minutos atrás, Brunds disse:

@Emooooo

 

Testa ae
 

  Ocultar conteúdo

 



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)
local waittime = 900
local storage = 100002

if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, "System", "Aguarde ".. exhaustion.get(cid, storage) .. " segundos para comer novamente.", MESSAGE_EVENT_ADVANCE)
return false
end
    local food = FOODS[item.itemid]
    if(not food) then
        return false
    end

    if((getPlayerFood(cid) + food[1]) >= 400) 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)
	exhaustion.set(cid, storage, waittime)
    return true
end

 

 

 

 

 

[06/04/2019 10:34:04] [Error - Action Interface] 
[06/04/2019 10:34:04] data/actions/scripts/other/food.lua:onUse
[06/04/2019 10:34:04] Description: 
[06/04/2019 10:34:04] (luaDoPlayerSendTextMessage) Player not found

Link para o comentário
Compartilhar em outros sites

  • 0

@Emooooo

 

Troca isso

 

local waittime = 900
local storage = 100002

if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, "System", "Aguarde ".. exhaustion.get(cid, storage) .. " segundos para comer novamente.", MESSAGE_EVENT_ADVANCE)
return false
end

por isso

 

local waittime = 900
local storage = 100002

if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, 22, "Aguarde ".. exhaustion.get(cid, storage) .. " segundos para comer novamente.", MESSAGE_STATUS_CONSOLE_ORANGE)
return false
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
6 minutos atrás, Brunds disse:

@Emooooo

 

Troca isso

 


local waittime = 900
local storage = 100002

if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, "System", "Aguarde ".. exhaustion.get(cid, storage) .. " segundos para comer novamente.", MESSAGE_EVENT_ADVANCE)
return false
end

por isso

 


local waittime = 900
local storage = 100002

if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, 22, "Aguarde ".. exhaustion.get(cid, storage) .. " segundos para comer novamente.", MESSAGE_STATUS_CONSOLE_ORANGE)
return false
end

 

[06/04/2019 10:54:24] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/food.lua)
[06/04/2019 10:54:24] data/actions/scripts/other/food.lua:101: '<eof>' expected near 'end'

Link para o comentário
Compartilhar em outros sites

  • 0
28 minutos atrás, Brunds disse:

@Emooooo olha se você copiou tudo corretamente ai ta falando que ta faltando um end...

[06/04/2019 11:54:15] [Error - Action Interface] 
[06/04/2019 11:54:15] data/actions/scripts/other/food.lua:onUse
[06/04/2019 11:54:15] Description: 
[06/04/2019 11:54:15] (luaDoPlayerSendTextMessage) Player not found
 

ele come ai da isso !

Link para o comentário
Compartilhar em outros sites

  • 0
3 horas atrás, Emooooo disse:

[06/04/2019 11:54:15] [Error - Action Interface] 
[06/04/2019 11:54:15] data/actions/scripts/other/food.lua:onUse
[06/04/2019 11:54:15] Description: 
[06/04/2019 11:54:15] (luaDoPlayerSendTextMessage) Player not found
 

ele come ai da isso !

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)
local waittime = 900
local storage = 100002

if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, 22, "Aguarde ".. exhaustion.get(cid, storage) .. " segundos para comer novamente.")
return false
end
    local food = FOODS[item.itemid]
    if(not food) then
        return false
    end

    if((getPlayerFood(cid) + food[1]) >= 400) 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)
	exhaustion.set(cid, storage, waittime)
    return true
end

 

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...