betoxz
Member
Hello people, I cant make the pick work on my server, shovel and rope is working but pick does not...
in my action.xml I have this:
in my pick.lua I have this:
and on actions.lua
I am using the correct ground 354 and 355, but still nothing happens..
Does anyone knows what's wrong?
SOLVED: I HAD TO ASSIGN action id 105 to the ground to make it work.
in my action.xml I have this:
Lua:
<action itemid="2553" script="tools/pick.lua" />
in my pick.lua I have this:
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
return onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
end
and on actions.lua
Code:
local groundIds = {354, 355} -- pick usable ground
function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
if target.itemid == 11227 then -- shiny stone refining
local chance = math.random(1, 100)
if chance == 1 then
player:addItem(ITEM_CRYSTAL_COIN) -- 1% chance of getting crystal coin
elseif chance <= 6 then
player:addItem(ITEM_GOLD_COIN) -- 5% chance of getting gold coin
elseif chance <= 51 then
player:addItem(ITEM_PLATINUM_COIN) -- 45% chance of getting platinum coin
else
player:addItem(2145) -- 49% chance of getting small diamond
end
player:addAchievementProgress("Petrologist", 100)
target:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
target:remove(1)
return true
end
local tile = Tile(toPosition)
if not tile then
return false
end
local ground = tile:getGround()
if not ground then
return false
end
if table.contains(groundIds, ground.itemid) and ground.actionid == actionIds.pickHole then
ground:transform(392)
ground:decay()
toPosition.z = toPosition.z + 1
tile:relocateTo(toPosition)
end
return true
end
I am using the correct ground 354 and 355, but still nothing happens..
Does anyone knows what's wrong?
SOLVED: I HAD TO ASSIGN action id 105 to the ground to make it work.
Last edited: