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

TFS creatureevents

k7aesa7r

New Member
Joined
Feb 23, 2014
Messages
7
Reaction score
0
Trying do that:
https://i.imgur.com/0CpELzV.gif
/\ It auto turn our character looking dir to the target pos

For tfs 1.0

Did this code in creature.lua :
Code:
function Creature:onTargetCombat(target)
    if Creature(cid) and Creature(target) then
        dir = getDirectionTo(creature:getPosition(), creature:getPosition(target))
        creature:setDirection(cid, dir)
    end
return true
end

But not working, could any help?

Author Credits:- xWhiteWolf
Anderson Faria
 
Last edited:
Code:
function Creature:onTargetCombat(target)
    local dir = getDirectionTo(self:getPosition(), target:getPosition())
    self:setDirection(dir)
    return true
end
 
Code:
function Creature:onTargetCombat(target)
    local Creature = Creature(cid)
    local dir = getDirectionTo(Creature:getPosition(), target:getPosition())
    Creature:setDirection(dir)
    return true
end

Try this :)
 
@Ninja
The script not working in those positions i writed above D:

When he in position 3 instead he look <--- he look --->
And position 7 he look <--- instead ----->
 
Remove the 5 lines below dir = WEST and dir = EAST, and don't you mean help me? :p
 
Back
Top