• 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 Remove slot item when into PZ

thokito

New Member
Joined
Aug 11, 2011
Messages
19
Reaction score
0
would like a script that if the player enters the pz area, remove an item from the ammunition slot
 
TFS version? I will post for 1.3 for now.
You should add this method if it doesn't exist in your TFS
then on data\events add/enable this.
XML:
<event class="Player" method="onChangeZone" enabled="1" />
and on data\events\scripts\player.lua add this
Lua:
function Player:onChangeZone(zone)
local slot = {10}
    if zone == ZONE_PROTECTION then
    local item = player:getSlotItem(slot)
    if item then
        item:remove()
    end
end
end
 
TFS version? I will post for 1.3 for now.
You should add this method if it doesn't exist in your TFS
then on data\events add/enable this.
XML:
<event class="Player" method="onChangeZone" enabled="1" />
and on data\events\scripts\player.lua add this
Lua:
function Player:onChangeZone(zone)
local slot = {10}
    if zone == ZONE_PROTECTION then
    local item = player:getSlotItem(slot)
    if item then
        item:remove()
    end
end
end
The OTX Server Version: (2.52 - 1557)

what I need would be like this. the player has item id 12424 in the arrow slot. when entering the pz, the item would move to the bp, if there was no bp the item would drop. like that, can you understand? ksks
 
Back
Top