• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Create is magic to TFS 1x

julhinhuu

New Member
Joined
Jul 16, 2011
Messages
35
Reaction score
0
Hello , I would like you to help me .
I need a spell that teleports the player 3 sqms over that same magic can not pass through walls, rivers , etc. Is magic also if there are 2 spaces can not be used .

So that's it , I hope to help me , thank you in advance .

TFS: 1x
Version: 10.90
 
Code:
    local position = player:getPosition()
    for i = 1, 3 do
        position:getNextPosition(player:getDirection())

        if position:isWalkable() then
            player:teleportTo(position)
        else
            break
        end
    end
 
You need to define player in your script.
Something like this.
Code:
local player = Creature(cid)
I tried this:
local player = Creature(cid)
local position = player:getPosition()
for i = 1, 3 do
position:getNextPosition(player:getDirection())

if position:isWalkable() then
player:teleportTo(position)
else
break
end
end

and so:

local player = Player(cid)
local position = player:getPosition()
for i = 1, 3 do
position:getNextPosition(player:getDirection())

if position:isWalkable() then
player:teleportTo(position)
else
break
end
end

and still the same error .
 
Back
Top