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

Function doMoveTo help

perdigs

New Member
Joined
Aug 22, 2010
Messages
114
Reaction score
1
I need a help in this script to function...this function get position and send the uid to this pos by calculating the route, but this function have a bug.

The bug is sent uid for all directions NORTH SOUTH, WEST, EAST, NORTHWEST, SOUTWEST...

The code is...

Code:
-- ORDER System
    function doMoveTo(cid, pos)
        local creature = cid
        local pokepos = getCreaturePosition(cid)
        local ir = pos

        if pokepos.x == ir.x and pokepos.y == ir.y then 
            return true
        end 
        if pokepos.x ~= ir.x or pokepos.y ~= ir.y then
            if(pokepos.y - ir.y) >= 1 then
                doPushCreature(creature, NORTH, pokepos.y - ir.y)
            end
        if(ir.y - pokepos.y) >= 1 then
            doPushCreature(creature, SOUTH, ir.y - pokepos.y)
        end
        if(pokepos.x - ir.x) >= 1 then
            doPushCreature(creature, WEST, pokepos.x - ir.x)
        end
        if(ir.x - pokepos.x) >= 1 then
            doPushCreature(creature, EAST, ir.x - pokepos.x)
        end
    return false
    end
end

use other function doPushCreature...i need a help to uid walk to NORTH, SOUTH, EAST AND WEST, only go to NORTHWAEST, or SOUTHWEST... in this example

http://img577.imageshack.us/i/77653426.png/

look the img the point A have brushs and to go to the target player need walk in SOUTHWEST to past to this brushs in the point B the player dont need to go to NORTHWEST direction to past, but the bug makes the player to northwest direction i need a change to player go north and after to west...
Plz help me THKS
 
Last edited:
Back
Top