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

TalkAction [1.3] Teleport where you look

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,323
Solutions
26
Reaction score
2,694
Location
Poland
because wand usage has its limitations,
I present you more powerful version of this: Action - [TFS 1.3] TP Wand for admins (updated)

Script summary: type "/look" and you will be tped anywhere you look

talkactions.xml
Code:
<talkaction words="/look" script="tplook.lua" />

tplook.lua
Code:
local storage = 400

function tpLook(player, destination)
    if player:getAccountType() >= ACCOUNT_TYPE_GOD and player:getStorageValue(storage) == 1 then
        player:teleportTo(destination)
    end
end

function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    if player:getStorageValue(storage) < 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Look teleport enabled.")
        player:setStorageValue(storage, 1)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Look teleport disabled.")
        player:setStorageValue(storage, 0)
    end
    return false
end

data/events/scripts/player.lua

below:
Code:
function Player:onLook(thing, position, distance)
add:
Code:
tpLook(self, position)

below:
Code:
function Player:onLookInBattleList(creature, distance)
add:
Code:
tpLook(self, creature:getPosition())
 
Last edited:
Is it possible to modify the usage with a right click instead of giving a look with both clicks? and that when teleportation has effects like those of the tp wand.
 
Is it possible to modify the usage with a right click instead of giving a look with both clicks? and that when teleportation has effects like those of the tp wand.
 
Back
Top