Having trouble making a civilization 6 tile movement system

i keep failing to make a script where i can leftclick on a npc then whilst holding down leftclick i release on a tile and the npc moves to said tileimage

Im doing the same thing, i got the moving part. Im trying to do it where it can only move to tiles within its movement range