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

Lua Function onMove

mackerel

Well-Known Member
Joined
Apr 26, 2017
Messages
398
Solutions
18
Reaction score
74
Hi, just wondering if there is a function to check whether creature moved

and it would be even better if there is a way to check in which direction they go. For example;
LUA:
function onMove(cid)
if not isPlayer(cid) then
   return false
end
if direction == WEST then
    do something
end

tfs 1.0
 
Solution
If it's certain tiles you can use a movement script (onStepIn)
There has been some attempts? to add an onMove event (not even sure if 1.0 has events, you should update to 1.2), but you can try one of these; Pull Requests · otland/forgottenserver · GitHub

You can also add a bounty to these if you wish;
onMove event? · Issue #775 · otland/forgottenserver · GitHub
onMove and onDropLoot · Issue #1049 · otland/forgottenserver · GitHub

so there is none. It would be useful to get one, but if you think of it. It can be quite an extensive function due to being executed everytime creature moves UNLESS

it is specified within code or registered under only certain creature!

Anyway ty
 
Back
Top