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

Lua pos action

knightxd

Member
Joined
Feb 21, 2009
Messages
211
Reaction score
16
Location
Rio de Janeiro
i need to execute an action after another ends;

like, when i sent an distance effect, when it gets it reach (ends) then another action start.

it can be used in move events, like you make a script to player start walk for random directions, then when he stop walking (script ends) then another action will happend like an magic effect sent, he will be teleported.. anything; i can't use addEvent(function,time) cause i can't know what time it will take cause it depends on random values..

does anyone know how to make something like that?
and event after ending an action?
 
The problems are:
If you use doSendDistanceEffect the effect will reach it's target directly it doesn't take. It hardly takes any time.
If you want to execute something after a player walked to next tile you won't be able to get the time he takes to be finished, because after clicking the next tile the player's position will be updated directly.
--> Maybe you could create a formula which calculates the time by including the player's movespeed or you could tell us what you exactly want and we could search a solution.
 
--> Maybe you could create a formula which calculates the time by including the player's movespeed
Hard to do in Lua, because player's speed could change during the autowalk, and terrain under player affects his speed too :p
 
Ye I never said it's a good solution, but it's the easiest with basic programming knowledge and I don't think he is advanced :)
 
Ye I never said it's a good solution, but it's the easiest with basic programming knowledge and I don't think he is advanced :)


idk much of cpp..
i want it for many things, one of them is making my summon walk to a place first then execute an action, like cut or anything.. and also i need to find the line in my source that let the summon go :p but i'll find it later, i need to now how can i make it in a cpp code, in lua i can try to combine the function on move (add it on source) and add use a flag to check if the "walk" is done, or get something with getdistancebetween... but it will be hard coded.. :X i think its so far easyer doing it from source.. :x
 
Back
Top