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

Item not able to trade.

could you please convert this script to tfs 1.x?
if i try to use it in my tfs 1.3 this happens
View attachment 61196
data/scripts/trade.lua
Lua:
local untradeItems = {2160}

local ec = EventCallback

function ec.onTradeRequest(player, target, item)
    if table.contains(untradeItems, item:getId()) then
        player:sendCancelMessage("You cannot trade this.")
        return false
    end
    return true
end

ec:register(1)
 
Last edited:
i go test tks mnas <3
Post automatically merged:

@Sarah Wesker

I put it inside the destination folder, do I need to register it somewhere? because just putting it inside nothing happens :(

View attachment 61206
Shows that it was loaded and everything!

View attachment 61207
Nothing is meant to happen, until you trade something that is on the blocked items list.
(which is currently a crystal coin itemid 2160)
 
i go test tks mnas <3
Post automatically merged:

@Sarah Wesker

I put it inside the destination folder, do I need to register it somewhere? because just putting it inside nothing happens :(

View attachment 61206
Shows that it was loaded and everything!

View attachment 61207

open data/events/events.xml

change
XML:
<event class="Player" method="onTradeRequest" enabled="0" />
to

XML:
<event class="Player" method="onTradeRequest" enabled="1" />
 
Back
Top