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

House teleport scroll?

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
921
Location
Chile
Hello guys, does anyone have a house teleport scroll for tfs 1.3??
like the player uses the scroll, it disapears and he gets teleported to his front door of his house, wich some magic spell? :D
 
Solution
Hi @Thorn look i maked this:
Code:
local useInProtectionZone = false
local useWithoutPzLocked = false
local useWithoutConditionFight = false
local successMessage = 'You have teleported to your house.'

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local okayTeleport = successMessage
    if useInProtectionZone and not Tile.hasFlag(Creature.getTile(player), TILESTATE_PROTECTIONZONE) then
        okayTeleport = 'Sorry, this parchment used in protection zone only.'
    end
    if useWithoutPzLocked and Player.isPzLocked(player) then
        okayTeleport = 'Sorry, this parchment used without PZ.'
    end
    if useWithoutConditionFight and Creature.getCondition(player, CONDITION_INFIGHT...
Hi @Thorn look i maked this:
Code:
local useInProtectionZone = false
local useWithoutPzLocked = false
local useWithoutConditionFight = false
local successMessage = 'You have teleported to your house.'

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local okayTeleport = successMessage
    if useInProtectionZone and not Tile.hasFlag(Creature.getTile(player), TILESTATE_PROTECTIONZONE) then
        okayTeleport = 'Sorry, this parchment used in protection zone only.'
    end
    if useWithoutPzLocked and Player.isPzLocked(player) then
        okayTeleport = 'Sorry, this parchment used without PZ.'
    end
    if useWithoutConditionFight and Creature.getCondition(player, CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
        okayTeleport = 'Sorry, this parchment used without fight condition.'
    end
    if okayTeleport == successMessage then
        if Player.getHouse(player) then
            local doorPosition = House.getExitPosition(Player.getHouse(player))
            Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
            Creature.teleportTo(player, doorPosition, false)
            Position.sendMagicEffect(doorPosition, CONST_ME_TELEPORT)
            Item.remove(item, 1)
            Player.sendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, okayTeleport)
        else
            okayTeleport = 'You not have a house.'
            Player.sendCancelMessage(player, okayTeleport)
            Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
        end
    else
        Player.sendCancelMessage(player, okayTeleport)
        Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
    end
    return true
end

I hope you like it.
 
Solution
Hi @Thorn look i maked this:
Code:
local useInProtectionZone = false
local useWithoutPzLocked = false
local useWithoutConditionFight = false
local successMessage = 'You have teleported to your house.'

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local okayTeleport = successMessage
    if useInProtectionZone and not Tile.hasFlag(Creature.getTile(player), TILESTATE_PROTECTIONZONE) then
        okayTeleport = 'Sorry, this parchment used in protection zone only.'
    end
    if useWithoutPzLocked and Player.isPzLocked(player) then
        okayTeleport = 'Sorry, this parchment used without PZ.'
    end
    if useWithoutConditionFight and Creature.getCondition(player, CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
        okayTeleport = 'Sorry, this parchment used without fight condition.'
    end
    if okayTeleport == successMessage then
        if Player.getHouse(player) then
            local doorPosition = House.getExitPosition(Player.getHouse(player))
            Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
            Creature.teleportTo(player, doorPosition, false)
            Position.sendMagicEffect(doorPosition, CONST_ME_TELEPORT)
            Item.remove(item, 1)
            Player.sendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, okayTeleport)
        else
            okayTeleport = 'You not have a house.'
            Player.sendCancelMessage(player, okayTeleport)
            Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
        end
    else
        Player.sendCancelMessage(player, okayTeleport)
        Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
    end
    return true
end

I hope you like it.
wow man that's awesome!! thanks for taking time to help me! :D
 
Hi @Thorn look i maked this:
Code:
local useInProtectionZone = false
local useWithoutPzLocked = false
local useWithoutConditionFight = false
local successMessage = 'You have teleported to your house.'

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local okayTeleport = successMessage
    if useInProtectionZone and not Tile.hasFlag(Creature.getTile(player), TILESTATE_PROTECTIONZONE) then
        okayTeleport = 'Sorry, this parchment used in protection zone only.'
    end
    if useWithoutPzLocked and Player.isPzLocked(player) then
        okayTeleport = 'Sorry, this parchment used without PZ.'
    end
    if useWithoutConditionFight and Creature.getCondition(player, CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
        okayTeleport = 'Sorry, this parchment used without fight condition.'
    end
    if okayTeleport == successMessage then
        if Player.getHouse(player) then
            local doorPosition = House.getExitPosition(Player.getHouse(player))
            Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
            Creature.teleportTo(player, doorPosition, false)
            Position.sendMagicEffect(doorPosition, CONST_ME_TELEPORT)
            Item.remove(item, 1)
            Player.sendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, okayTeleport)
        else
            okayTeleport = 'You not have a house.'
            Player.sendCancelMessage(player, okayTeleport)
            Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
        end
    else
        Player.sendCancelMessage(player, okayTeleport)
        Position.sendMagicEffect(Creature.getPosition(player), CONST_ME_POFF)
    end
    return true
end

I hope you like it.
i can use it anytime, even when im not in pz or attacking.. what should i change?
 
Back
Top