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

Solved Updating to 1.0

Aleada

Unknown Member
Joined
Mar 14, 2013
Messages
231
Reaction score
7
I've been having some troubles updating my scripts from 0.4 to 1.0.. I've updated about 3/4 of them but some are giving me troubles.. For example, "doSteerCreature" doesn't exist in 1.0. For example:
This is my 0.4 "doSteerCreature" script:
Code:
function onThink()
local NW = {x = 521, y = 1541, z = 11}
local N = {x = 522, y = 1541, z = 11}
local NE = {x = 523, y = 1541, z = 11}
local E = {x = 523, y = 1542, z = 11}
local SE = {x = 523, y = 1543, z = 11}
local S = {x = 522, y = 1543, z = 11}
local SW = {x = 521, y = 1543, z = 11}
local W = {x = 521, y = 1542, z = 11}
local pos = getCreaturePosition(getNpcId())
    if ((pos.x == NW.x and pos.y == NW.y) or (pos.x == N.x and pos.y == N.y) or (pos.x == NE.x and pos.y == NE.y) or (pos.x == E.x and pos.y == E.y) or (pos.x == SE.x and pos.y == SE.y) or (pos.x == S.x and pos.y == S.y) or (pos.x == SW.x and pos.y == SW.y) or (pos.x == W.x and pos.y == W.y)) then
        doCreatureSay(getNpcId(), "Thank you again!", TALKTYPE_MONSTER)
        doRemoveCreature(getNpcId())
    else
        doSteerCreature(getNpcId(), {x = 522, y = 1542, z = 11})
    end
end

--------------
Solved... I pasted below for those who might have the same problem!
 
Last edited:
If anyone was curious I figured out the "doSteerCreature" script (however it walks on non-walkable tiles :p):
Code:
function onThink(cid)
local creature = Creature("Farmer's Son")
local ladder_pos, npc_pos = {x = 522, y = 1542, z = 11}, creature:getPosition()
    if npc_pos.x > ladder_pos.x then
        creature:teleportTo({x = (npc_pos.x - 1), y = npc_pos.y, z = npc_pos.z}, true)
    elseif npc_pos.x < ladder_pos.x then
        creature:teleportTo({x = (npc_pos.x + 1), y = npc_pos.y, z = npc_pos.z}, true)
    elseif npc_pos.y < ladder_pos.y then
        creature:teleportTo({x = npc_pos.x, y = (npc_pos.y + 1), z = npc_pos.z}, true)
    elseif npc_pos.y > ladder_pos.y then       
        creature:teleportTo({x = npc_pos.x, y = (npc_pos.y - 1), z = npc_pos.z}, true)
    else
        creature:say("Thank you again!", 1)
        creature:remove()
    end
end

Hopefully this helps some!
 
Back
Top