Log in

View Full Version : Follow Script Help please!



tempz
08-31-2016, 04:24 PM
Can anyone help me with a follow script that will work smooth while targeting is on, im trying to use this script but it does not work well. It keeps following while trying to target monster.
Could someone tell me how to make it so it stops following when monsters on screen and continues when monsters are dead?



local target = ""

Module("autoFollow", function(module)
local player = Creature(target)
print(target)
if player:isOnScreen(true) then
Creature.Follow(target)
end
end, false)

function onSpeak(chat, msg)
chat:SendYellowMessage(Self.Name(), msg)
if (msg == "start") then
Module("autoFollow"):Start()
chat:SendOrangeMessage("Console", string.format("Started following %s.", target ))
elseif (msg == "stop") then
Module("autoFollow"):Stop()
chat:SendOrangeMessage("Console", "Stoped following.")
elseif msg:match("^name") then
local name = msg:match("^follow (.+)")
if name then
Module("autoFollow"):Stop()
target = name
chat:SendOrangeMessage("Control", "New player added.")
end
end
end

function onClose() end

local chat = Channel("autoFollow", onSpeak, onClose)

Trykon
08-31-2016, 07:59 PM
https://www.dropbox.com/s/5ljulmyks7yvqxe/Follow.lua?dl=0
This one fights when desired monsters on screen and folloes the rest of time
But mind that it is not walking on stairs etc

Pat
09-01-2016, 10:32 AM
This is awesome, just found it so that I can use it on an OT server - thanks!