• 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 attempt to call method 'sendCancelMessage'

peteralto

Member
Joined
Nov 1, 2020
Messages
93
Solutions
1
Reaction score
17
Could someone tell me the reason for the error?

Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/others/tilepa/tilepa.lua:onStepIn
data/movements/scripts/others/tilepa/tilepa.lua:5: attempt to call method 'sendCancelMessage' (a nil value)
stack traceback:
    [C]: in function 'sendCancelMessage'
    data/movements/scripts/others/tilepa/tilepa.lua:5: in function <data/movements/scripts/others/tilepa/tilepa.lua:1>

movements/tilepa.lua
Lua:
function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() or not creature:isPremium() then
        creature:teleportTo(fromPosition)
        creature:getPosition():sendMagicEffect(CONST_ME_POFF)
        creature:sendCancelMessage("No have Premium.")
        return false
    end
    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end

Thanks
 
not creature:isPlayer()
trying to call sendCancelMessage on a non-player creature? XD
That method seems to be only available for player
 
Maybe you don't have this function in your lib.

sendCancelMessage
I checked, the function is ok.
not creature:isPlayer()
trying to call sendCancelMessage on a non-player creature? XD
That method seems to be only available for player
I will try to redo the code. Thanks.
 
Back
Top