local config = {
wall_action_id = 12345, -- action ID of your wall
onBreakMsg = 'KABOOOM!', -- msg when they break it
onBreakEffect = CONST_ME_BLOCKHIT, -- effect when they break it
errorMsg = 'Special wall not found.' -- msg if wall not found
}
function onSay(player, words, param)
local pos = player:getPosition()
local wallPos = Position(pos.x, pos.y-1, pos.z)
local tile = Tile(wallPos)
if not tile then
player:sendCancelMessage(config.errorMsg)
pos:sendMagicEffect(CONST_ME_POFF)
return false
end
local tileThings = tile:getItems()
for i = 1,#tileThings do
local wall = tile:getThing(i)
if wall and (wall:getActionId() == config.wall_action_id) then
player:say(config.onBreakMsg, TALKTYPE_MONSTER_SAY)
wallPos:sendMagicEffect(config.onBreakEffect)
wall:remove()
return false
end
end
player:sendCancelMessage(config.errorMsg)
pos:sendMagicEffect(CONST_ME_POFF)
return false
end