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

Lua [TFS 1.0] For what function i can change this.

Techrlz

System Manager & Programmer
Premium User
Joined
Feb 20, 2014
Messages
1,073
Solutions
4
Reaction score
177
Code:
local toPos = getCreatureLookPosition(cid)
 
Here you go
Code:
  -- for players
  getPlayerLookDir(cid)

  -- for creatures
  local creature = --[[...]]
  creature:getDirection()
 
paste it in your global.lua
Code:
function Position.getNextPosition(self, direction, steps)
   steps = steps or 1
   if direction == WEST then
     self.x = self.x - steps
   elseif direction == EAST then
     self.x = self.x + steps
   elseif direction == NORTH then
     self.y = self.y - steps
   elseif direction == SOUTH then
     self.y = self.y + steps
   end
end

function Creature.getLookPosition(self)
    return self:getPosition():getNextPosition(self:getDirection())
end
and you can use
Code:
Creature(cid):getLookPosition()
-- edit small mistake
 
Last edited:
Back
Top Bottom