local config = {
-- bridgeActionID | townID | kickPosition
[0001] = {tid = 1, position = Position(1001, 1001, 7)},
[0002] = {tid = 2, position = Position(1002, 1002, 7)},
[0003] = {tid = 2, position = Position(1003, 1003, 7)},
[0004] = {tid = 3, position = Position(1004, 1004, 7)},
[0005] = {tid = 4, position = Position(1005, 1005, 7)}
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local townId = config[item.actionid]
if not townId then
return true
end
local town = Town(townId.tid)
if not town then
return true
end
if player:getTown() ~= town then
player:teleportTo(townId.position)
townId.position:sendMagicEffect(CONST_ME_TELEPORT)
player:sendCancelMessage("You can't blaballablalblalblalba.")
end
return true
end