I have a script I wrote while following a long to a detailed YouTube video (its for an AI which follows you) in the vid he uses "dist" and i used it just like he dose
if (head.Position - rootPart.Position).magnitude < dist and humanoid.Health > 0 then dist = (head.Position - rootPart.Position).magnitude target = head
the error i keep getting is W003;(12,55)Global dist is only used in the enclosing function; consider changing it to local in script analysis
Dose anyone know how to fix this problem
if you do thx :D
ok srry for posting this but if any one else has this problem when you defined the variables you did a type-o