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

commit support talkactions

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,209
Solutions
2
Reaction score
154
Someone can help me? I'm using tfs 1.2 and tried to update looking this commit:
Move !sellhouse to talkactions · otland/forgottenserver@1c227d3 · GitHub

LUA:
function onSay(player, words, param)
     local tradePartner = Player(param)
     if not tradePartner or tradePartner == player then
         player:sendCancelMessage("Trade player not found.")
         return false
     end
     local house = player:getTile():getHouse()
     if not house then
         player:sendCancelMessage("You must stand in your house to initiate the trade.")
         return false
     end
     local returnValue = house:startTrade(player, tradePartner)
     if returnValue ~= RETURNVALUE_NOERROR then
         player:sendCancelMessage(returnValue)
     end
     return false
end

but I have an error when try to sell house:

Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/sellhouse.lua:onSay
data/talkactions/scripts/sellhouse.lua:14: attempt to call method 'startTrade' (a nil value)
stack traceback:
        [C]: in function 'startTrade'
        data/talkactions/scripts/sellhouse.lua:14: in function <data/talkactions/scripts/sellhouse.lua:4>
 
Back
Top