why wont this work?
01 | local p = game:GetService( "PathfindingService" ) |
04 | local torso,humanoid = script.Parent:WaitForChild( "Torso" ),script.Parent:WaitForChild( "Humanoid" ) |
05 | torso.Touched:connect( function () |
11 | local target = script.Parent.Targe.Value.Torso |
12 | local path = p:ComputeSmoothPathAsync(torso.Position,target.Position, 500 ) |
13 | if path.Status.Name = = "Success" then |
14 | local points = path:GetPointCoordinates() |
15 | for i,point in pairs (points) do |
16 | local part,P = workspace:FindPartOnRay(Ray.new(point,Vector 3. new( 0 ,- 10 , 0 ))) |
24 | local point = points [ i ] |
25 | humanoid:MoveTo(point) |
27 | if point.Y> = torso.Position.Y- 1.5 then |
29 | jump = humanoid.Changed:connect( function () |
33 | local reached = humanoid.MoveToFinished:wait() |
42 | humanoid:MoveTo(torso.CFrame*Vector 3. new( 0 , 0 , 5 )) |
43 | humanoid.MoveToFinish:wait() |
it is a pathfind script. i use a different model to make my own but this does not work. in the output this error pops up. 00:30:36.619 - Unable to cast Instance to Vector3
00:30:36.619 - Script 'Workspace.Police.Script', Line 25 - local walk
00:30:36.619 - Script 'Workspace.Police.Script', Line 47
00:30:36.620 - Stack End
can someone help me please