Code:
function onSay(player, words, param)
local position = player:getPosition()
local tile = Tile(position)
local house = tile and tile:getHouse()
if house == nil then
player:sendCancelMessage("You are not inside a house.")
position:sendMagicEffect(CONST_ME_POFF)
return false
end
if house:getOwnerGuid() ~= player:getGuid() then
player:sendCancelMessage("You are not the owner of this house.")
position:sendMagicEffect(CONST_ME_POFF)
return false
end
house:setOwnerGuid(0)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have successfully left your house.")
position:sendMagicEffect(CONST_ME_POFF)
return false
end
how can i do to not execute the Talkaction script if the player don't have a determinated storage? do a check, if the player don't have the storage de talkaction no work.