0 Members and 1 Guest are viewing this topic.
target_movement:set_target(map:get_entities("bird_"))
make a loop to detect the closest entity from a list of entities
-- Call a function every second.sol.timer.start(5000, function() local birds = map:get_entities("bird_") local npc_near_birds = npc_1:get_distance(birds) if npc_near_birds < 10 then movement = sol.movement.create("target") movement:set_target(birds) movement:set_speed(48) movement:start(npc_1) end return true -- To call the timer again (with the same delay).end)
I think the best example would be the "Evil Tile". these are the tiles in dungeons that lift up and fly at the hero, one at a time, with a timed delay between each tile's movements.