• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved

tozikrulz

New Member
Joined
Jun 10, 2009
Messages
46
Reaction score
1
I have made a simple mining script which works, except for removing the item, the item does get removed if the player has it on them or in their bp but if the item is on the floor it can be used forever without being removed, please could someone show me where i've gone wrong as i would love to use this feature.
I'm running 0.3.6 and here is the script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

randomNumber = math.random(1, 100)

if itemEx.itemid == 1285 then
if randomNumber >= 75 then
    doPlayerAddItem(cid, 2157, math.random(5, 10))
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
elseif randomNumber >= 50 and randomNumber < 75 then
    doPlayerAddItem(cid, 2160, math.random(25, 50))
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
elseif randomNumber >= 25 and randomNumber < 50 then
    doPlayerAddItem(cid, 6527, math.random(1, 5))
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
elseif randomNumber < 25 then
    doPlayerRemoveItem(cid, item.itemid, 1)
    doSendMagicEffect(fromPosition, CONST_ME_POFF)
else
    doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
end
else
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You can\'t mine this.')
end

return true
end
 
try this?
doPlayerRemoveItem(item.uid, item.itemid, 1)

it should call where the item is whether it be cid or on the floor and remove it
 
this will not remove from floor or bp and gave this error

[27/05/2016 18:06:21] [Error - Action Interface]
[27/05/2016 18:06:21] data/actions/scripts/tools/pick.lua:onUse
[27/05/2016 18:06:21] Description:
[27/05/2016 18:06:21] (luaDoPlayerRemoveItem) Player not found
 
Back
Top