• 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!

Lua function onDropItem TFS 1.1

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,571
Solutions
3
Reaction score
98
Location
Portugal
Hey there, does TFS 1.1 have any function like Player: onDropItem?

I know there is:

Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)

But in this case I really need onDropItem...

If theres no such function can you help me creating one?

All I can make is:

Code:
function Player:onDropItem(item, count, fromPosition, toPosition)
    local count = player:getItemById(item:getId())
    if item:getActionId() == 2222 and count >= 1 then
        self:sendTextMessage(MESSAGE_STATUS_WARNING, "You can't drop this item...")
    return false
    end
return true
end

The drop part I have no idea how I should do it...
 
Yeah but that droploot is onDeath :X

I actually wanted to create a custom function onDrop, I guess there must be a way to use onMoveItem to check if its ground and return false but I have no idea how to do it

something like

Code:
local topos = getGroundId

function Player:onMoveItem(item, count, fromPosition, toPosition)
if topos is ground then
       player:sendCancel("You can't drop this item.)
return false
end
return true
end
 
Code:
if position.x ~= 65535 then
    if item:getActionId() == 2222 then
        self:sendTextMessage(MESSAGE_STATUS_WARNING, "You can't drop this item...")
        return false
    end
end
This is best you can do atm. Because can't even send out "probes" anymore.
Gotta wait for TFS update.

Right now they can drop them in any kind of containers.

It's prolly possible with TFS 1.0 before they changed the way Unique ID's work.
 

Similar threads

Back
Top