• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Remove corpse after using

noshirtstan

New Member
Joined
Aug 2, 2020
Messages
68
Reaction score
2
Hey folks, im trying to set it so that, when you use the corpse (2992 - dead rabbit) it removes the corpse for the game. I think i have the syntax wrong. I've tried, item:removeItem(2992, 1) as well as doRemoveItem(2992, 1) but have no success on either front.

Here is what i have so far.

LUA:
elseif item.itemid == 2992 and isInArray({50605, 50602, 50603, 50604}, item.actionid) then
        if player:getCondition(player, CONDITION_COOLDOWN, 160) then
            player:sendCancelMessage("You are already gathering!")
            return true
        end
        
        if not player:isGatheringJob(item.actionid) then
            player:sendCancelMessage("You must learn "..craftingGatheringJobConfig[item.actionid].skillName.." before using this.")
            return true
        end
        
        if player:isGatheringJob(item.actionid) then
        
            if player:getItemCount(13828) >= 1 then -- check for knife
            mathCheck = math.floor(math.random() * 100) + 1
            if (0 < mathCheck and mathCheck < 25) then
                player:addItem(26414, math.floor(math.random() * 2) + 1)
            elseif (26 < mathCheck and mathCheck < 50) then
                player:addItem(26415, math.floor(math.random() * 2) + 1)
            elseif (51 < mathCheck and mathCheck < 75) then
                player:addItem(26416, math.floor(math.random() * 2) + 1)
            elseif (76 < mathCheck and mathCheck < 100) then
                player:addItem(26417, math.floor(math.random() * 2) + 1)
            end
            item:removeItem(2992, 1)
            else
                player:sendCancelMessage("You need a skinning knife to use this!")
                return true
                end
                
            end

Any thoughts?
 
Solution
X
Hey folks, im trying to set it so that, when you use the corpse (2992 - dead rabbit) it removes the corpse for the game. I think i have the syntax wrong. I've tried, item:removeItem(2992, 1) as well as doRemoveItem(2992, 1) but have no success on either front.

Here is what i have so far.

LUA:
elseif item.itemid == 2992 and isInArray({50605, 50602, 50603, 50604}, item.actionid) then
        if player:getCondition(player, CONDITION_COOLDOWN, 160) then
            player:sendCancelMessage("You are already gathering!")
            return true
        end
       
        if not player:isGatheringJob(item.actionid) then
            player:sendCancelMessage("You must learn...
Hey folks, im trying to set it so that, when you use the corpse (2992 - dead rabbit) it removes the corpse for the game. I think i have the syntax wrong. I've tried, item:removeItem(2992, 1) as well as doRemoveItem(2992, 1) but have no success on either front.

Here is what i have so far.

LUA:
elseif item.itemid == 2992 and isInArray({50605, 50602, 50603, 50604}, item.actionid) then
        if player:getCondition(player, CONDITION_COOLDOWN, 160) then
            player:sendCancelMessage("You are already gathering!")
            return true
        end
       
        if not player:isGatheringJob(item.actionid) then
            player:sendCancelMessage("You must learn "..craftingGatheringJobConfig[item.actionid].skillName.." before using this.")
            return true
        end
       
        if player:isGatheringJob(item.actionid) then
       
            if player:getItemCount(13828) >= 1 then -- check for knife
            mathCheck = math.floor(math.random() * 100) + 1
            if (0 < mathCheck and mathCheck < 25) then
                player:addItem(26414, math.floor(math.random() * 2) + 1)
            elseif (26 < mathCheck and mathCheck < 50) then
                player:addItem(26415, math.floor(math.random() * 2) + 1)
            elseif (51 < mathCheck and mathCheck < 75) then
                player:addItem(26416, math.floor(math.random() * 2) + 1)
            elseif (76 < mathCheck and mathCheck < 100) then
                player:addItem(26417, math.floor(math.random() * 2) + 1)
            end
            item:removeItem(2992, 1)
            else
                player:sendCancelMessage("You need a skinning knife to use this!")
                return true
                end
               
            end

Any thoughts?
// item:remove([count = -1])
item:remove()
 
Solution
Back
Top