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

Tile that changes look dir

MalyFanek

New Member
Joined
Oct 10, 2019
Messages
37
Reaction score
2
As i cant find solution of a problem i have that monsters/npc stands always face to north so i had idea to do tile that switch their lookdir, but i need some help how to do it/edit, im fresh in making ots so any help will be awesome ;p
But all my tries ends in errors at console ;x No idea shall it be aid or uid? Maybe thats what im doing wrong ;/

Found that
Code:
getPlayerLookDir = getCreatureLookDirection
getPlayerLookDirection = getCreatureLookDirection
doCreatureSetLookDir = doCreatureSetLookDirection
getPlayerLookPos = getCreatureLookPosition

getPosByDir = getPositionByDirection

And thats my trying to make it work:
Code:
local dirs = {"south", "east", "north", "west"}
local tile.actionid = {2501, 2502, 2503, 2504}
local nextDir = dirs[i + 1]

function onStepIn (cid, creature, direction, aid)

if tile.actionid == 2501 and
if(creature:isNPC)|| if(creature:isMonster) then
getPosByDir == "north" then
doCreatureSetLookDirection
== "south"

return true
end

and other try:
Code:
function getPositionByDirection(cid, position, direction, size)
    local actionid = {2501, 2502, 2503, 2504}
    local n = size or 1
    local table_dirs = {
["south"] == position.y = position.y + n},
["north"] == position.y = position.y - n},
["east"] == position.x = position.x + n},
["west"] == position.x = position.x - n}



function onStepIn (cid, creature, direction, aid)

if actionid == 2501 then
doCreatureSetLookDir == south
end


return true
else

getPosByDir == north then
doCreatureSetLookDir == south
end


return true
end

I know for sure i does something wrong, but i just need some tip/help cuz as i said im fresh and need to learn some things ;p

Even if u know/make any ready script (what will be great) will be nice to explain working of it etc.



//Edit Client 8,6 TFS 0,4 rev 3777
 
Last edited:
5. Incomplete Problem Description:
- Post as much useful information as possible. If the problem is about something on your server, post the server version and client version. Also always post the errors you get and the scripts with the problems.
 
Yes sorry i forgot to mention it, TFS 0,4 rev 3777,
source
Code:
https://tibiaking.com/forums/topic/76241-dbo-rox-v2-860-open-source99-sem-bugs/
I know i shouldnt advertise other webs but it might be helpfull.


Btw i tried many scripts etc and this one work w/o console error
Code:
local dirs = {"south", "east", "north", "west"}
local aid = {2501, 2502, 2503, 2504}


function onStepIn (cid, creature, direction, aid)

local tile = Tile(creature:getDirection()):getGround()
   if ground.aid == 2501 then
    doCreatureSetLookDirection = SOUTH
    return true
   
    else
doCreatureSetLookDirection = SOUTH
    return true
    end
    end
But still its not this one, cuz nothing happens

tried to make 0 than south cuz thats what i have at lib's, still nothing, also tried to make
position.y + 1],

Any tips/ideas? As i said im fresh and trying to learn so even small tip might be helpfull ;)
And once again sry i broke the rules
 
Try this one
 
Solution
Works, Thanks.
Looks like i been typing wrong in search and didnt though about making startup at global events only tried to do aid/mov.... anyway THX a lot!
 
Back
Top