Ir para conteúdo
  • 0

Function onUse (Exhausted)


koete

Pergunta

Bom eu tentei e tentei mas não pude resolver meu problema sozinho

são 3:25 e resolvi pedir ajuda nesse script

eu apenas não consigo colocar exhausted no script para o player não ficar usando toda hora

se alguem puder me ajudar vou ficar muito agradecido

 

 

 

 

 

items = { 
[0] = {id = 3004, count = 1, chance = 55}, 
[1] = {id = 2996, count = 1, chance = 5}, 
[2] = {id = 3011, count = 1, chance = 1}, 
[3] = {id = 3010, count = 1, chance = 1}, 
[4] = {id = 2994, count = 1, chance = 1}, 
[5] = {id = 3005, count = 1, chance = 1},
[6] = {id = 2995, count = 1, chance = 1}, 
[7] = {id = 3090, count = 1, chance = 1}, 
[8] = {id = 3067, count = 1, chance = 1}, 
[9] = {id = 3055, count = 1, chance = 1}, 
[10] = {id = 2993, count = 1, chance = 5},
[11] = {id = 2992, count = 1, chance = 5}, 
[12] = {id = 2991, count = 1, chance = 5}, 
[13] = {id = 2990, count = 1, chance = 5}, 
[14] = {id = 2989, count = 1, chance = 5}, 
[15] = {id = 2988, count = 1, chance = 5},
[16] = {id = 2987, count = 1, chance = 5}, 
[17] = {id = 2986, count = 1, chance = 5}, 
[18] = {id = 3001, count = 1, chance = 20}, 
[19] = {id = 3003, count = 1, chance = 25}, 
[20] = {id = 3071, count = 1, chance = 30},
[21] = {id = 2999, count = 1, chance = 35}, 
[22] = {id = 3002, count = 1, chance = 40}, 
[23] = {id = 2998, count = 1, chance = 45}, 
[24] = {id = 3000, count = 1, chance = 50}
} 

local time = 180 -- Tempo de Exhaustion (segundos)


function onUse(cid, item, fromPos, item2, toPos) 
       if item2.itemid == 2963 or item2.itemid == 2964 or item2.itemid == 2965 or item2.itemid == 2966 or item2.itemid == 2967 or item2.itemid == 2968 or item2.itemid == 2971 or item2.itemid == 2972 or item2.itemid == 2973 then
for i = 0, #items do 
if (items[i].chance > math.random(1, 100)) then 
doPlayerAddItem(cid, items[i].id, items[i].count) 
return doCreatureSay(cid, 'Wow Você Ganho! Seu Item e '..getItemNameById(items[i].id)..'!', TALKTYPE_MONSTER) 
end 
end 
return 
end
end

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

testa ai

items = {
[0] = {id = 3004, count = 1, chance = 55},
[1] = {id = 2996, count = 1, chance = 5},
[2] = {id = 3011, count = 1, chance = 1},
[3] = {id = 3010, count = 1, chance = 1},
[4] = {id = 2994, count = 1, chance = 1},
[5] = {id = 3005, count = 1, chance = 1},
[6] = {id = 2995, count = 1, chance = 1},
[7] = {id = 3090, count = 1, chance = 1},
[8] = {id = 3067, count = 1, chance = 1},
[9] = {id = 3055, count = 1, chance = 1},
[10] = {id = 2993, count = 1, chance = 5},
[11] = {id = 2992, count = 1, chance = 5},
[12] = {id = 2991, count = 1, chance = 5},
[13] = {id = 2990, count = 1, chance = 5},
[14] = {id = 2989, count = 1, chance = 5},
[15] = {id = 2988, count = 1, chance = 5},
[16] = {id = 2987, count = 1, chance = 5},
[17] = {id = 2986, count = 1, chance = 5},
[18] = {id = 3001, count = 1, chance = 20},
[19] = {id = 3003, count = 1, chance = 25},
[20] = {id = 3071, count = 1, chance = 30},
[21] = {id = 2999, count = 1, chance = 35},
[22] = {id = 3002, count = 1, chance = 40},
[23] = {id = 2998, count = 1, chance = 45},
[24] = {id = 3000, count = 1, chance = 50}
}
local time = 2000 -- Tempo de Exhaustion (1000 por segundos)
function onUse(cid, item, fromPos, item2, toPos)
if getPlayerStorageValue(cid, 141012) >= os.time() then return true end
if item2.itemid == 2963 or item2.itemid == 2964 or item2.itemid == 2965 or item2.itemid == 2966 or item2.itemid == 2967 or item2.itemid == 2968 or item2.itemid == 2971 or item2.itemid == 2972 or item2.itemid == 2973 then
for i = 0, #items do
if (items[i].chance > math.random(1, 100)) then
doPlayerAddItem(cid, items[i].id, items[i].count)
doCreatureSay(cid, 'Wow Você Ganho! Seu Item e '..getItemNameById(items[i].id)..'!', TALKTYPE_MONSTER)
setPlayerStorageValue(cid, 141012, os.time() + time / 1000)
return 1
end
end
return 1
end
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...