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

Follow.

Il Knight

Veteran OT User
Joined
Dec 1, 2014
Messages
676
Solutions
7
Reaction score
350
Location
Spain
Hi, today im triying to do this =

Monster Follow Master if target = NULL <

I remove this from Monster.cpp

if target ==(nullptr) then

monster:setFollowCreature(master)

Now if you summon something, never follow you.

because have 2 seconds of exhausted, so if the "master" stop, and walk, the Monster get idle 2 seconds

so i made this =

Code:
function onThink(cid, interval)
local monster = Monster(cid)
local master = monster:getMaster()
local target = master:getTarget()

function pokemon ()
monster:setFollowCreature(master)
end

if last_interval == nil then
      last_interval = os.clock()
    end
    if (os.clock() - last_interval) > 0 then


if target ==(nullptr) then

monster:setFollowCreature(master)
addEvent(pokemon,250)
addEvent(pokemon,500)
addEvent(pokemon,750)
return true
end

last_interval= os.clock()

end
    return true
end

each 250 Ms the script check if the Master have a target and follow the Master if not, but now still the problem if the master STOP, the Monster get idle for 2 seconds again :S

i already try to use this =
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)
addEvent(pokemon,100)

to make it FASTER 10x seconds, but still the problem, if you stop, your summon stop for 2 seconds S:

i need to ALWAYS FOLLOW the master if target = Null.
Like when a player follow other player.

some help?
 
script on think removed.
goToFollowCreature(); added on monster.cpp
1>------ Build started: Project: theforgottenserver, Configuration: Release x64 ------
1> monster.cpp
1> Generating code

1-2 min compiling.
 
Back
Top