- Awards
- 38
Hola a todos
Hoy os comparto el sistema de Mining System con la funcion de remover la piedra al usar el Pick encima de ella, obteniendo asi Gemas, con 2 Possibilidades:
Target 1285 = Es la ID de la piedra
if chance <=9556 then
player:addItem(38614, 1) <--- Aqui es la piedra la mas obtenida 95%
else
player:additem(38615, 1) <--- Aqui es la piedra menos obtenida 5%
Hoy os comparto el sistema de Mining System con la funcion de remover la piedra al usar el Pick encima de ella, obteniendo asi Gemas, con 2 Possibilidades:
Target 1285 = Es la ID de la piedra
if chance <=9556 then
player:addItem(38614, 1) <--- Aqui es la piedra la mas obtenida 95%
else
player:additem(38615, 1) <--- Aqui es la piedra menos obtenida 5%
Código:
local rocking = Action()
function rocking.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == then
if target.itemid == 1285 then
local chance = math.random(1, 10000)
target:getPosition():sendMagicEffect(CONST_ME_HITAREA)
target:remove(1)
if chance <= 9556 then
player:addItem(38614, 1)
else
player:addItem(38615, 1)
end
end
end
end
rocking:id()
rocking:register()