r=script.Parent script:WaitForChild("\084\111")pos=script.Parent.CFrame g,p=r:FindFirstChild("\098\103")or script.bg,r:FindFirstChild("\098\112")or script.bp g.Parent,p.Parent=r,r p.position=r.Position function got(v)if v:IsDescendantOf(workspace.Pick)then if v.Parent.Name=="\077\111\100"then r.Parent=v.Parent script.To.Value=workspace.Finish else local f=Instance.new("\077\111\100\101\108",workspace.Pick)r.Parent,v.Parent=f,f f.Name="\077\111\100"end local f=Instance.new("\087\101\108\100",r)f.Part0=r f.Part1=v f.C0=CFrame.new(0,0,-r.Size.Z/2-.1)f.C1=CFrame.new(0,0,v.Size.Z/2)elseif r.Parent.Name=="\077\111\100"then r.Parent:Destroy()script.Disabled=true r:Destroy()script:Destroy()return true else script.Disabled=true r:Destroy()script:Destroy()return true end end wait(.1)local v=script.To.Value.Parent while 1 do if script.To.Value and(script.To.Value.Parent and script.To.Value.Parent==v)then path=(game:GetService("\080\097\116\104\102\105\110\100\105\110\103\083\101\114\118\105\099\101")):ComputeRawPathAsync(pos.p,script.To.Value.Position,100)s2=(path:GetPointCoordinates())[2]or(path:GetPointCoordinates())[1]a,b=workspace:FindPartOnRay(Ray.new(pos.p,Vector3.new(0,-6)),r.Parent)w=0 repeat w=w+1 if s2 then local v=CFrame.new(pos.p,s2)pos=v*CFrame.new(0,0,-0.3)a,b=workspace:FindPartOnRay(Ray.new(pos.p,Vector3.new(0,-6)),r.Parent)p.position=Vector3.new(pos.X,b.Y+.3,pos.Z)g.cframe=r.Velocity.magnitude>.5 and CFrame.new(r.Position,r.Position+r.Velocity)or g.cframe if(Vector3.new(r.Position.X,0,r.Position.Z)-Vector3.new(pos.X,0,pos.Z)).magnitude>3 then r.CFrame=(r.CFrame-r.Position)+Vector3.new(pos.X,b.Y+.3,pos.Z)end else break end wait()until(r.Position-Vector3.new(s2.X,b.y,s2.Z)).magnitude<1 or(r.Position-Vector3.new(s2.X,b.y,s2.Z)).magnitude>6 or w>20 if script.To.Value and(r.Position-script.To.Value.Position).magnitude<8 then if got(script.To.Value)then break end end else script.To.Value,v=workspace.Finish,workspace wait()end end
--script.Parent:Destroy()
r = script.Parent
script:WaitForChild("To")
pos = script.Parent.CFrame
g, p = r:FindFirstChild("bg") or script.bg, r:FindFirstChild("bp") or script.bp
g.Parent, p.Parent = r, r
p.position = r.Position
function got(t)
	if t:IsDescendantOf(workspace.Pick) then
		if t.Parent.Name == "Mod" then
			r.Parent = t.Parent
			script.To.Value = workspace.Finish
		else
			local m = Instance.new("Model", workspace.Pick)
			r.Parent, t.Parent = m, m
			m.Name = "Mod"
		end
		local w = Instance.new("Weld", r)
		w.Part0 = r
		w.Part1 = t
		w.C0 = CFrame.new(0, 0, -r.Size.Z / 2 - 0.1)
		w.C1 = CFrame.new(0, 0, t.Size.Z / 2)
	elseif r.Parent.Name == "Mod" then
		r.Parent:Destroy()
		script.Disabled = true
		r:Destroy()
		script:Destroy()
		return true
	else
		script.Disabled = true
		r:Destroy()
		script:Destroy()
		return true
	end
end
wait(0.1)
local rss = script.To.Value.Parent
while 1 do
	if script.To.Value and script.To.Value.Parent and script.To.Value.Parent == rss then
		path = game:GetService("PathfindingService"):ComputeRawPathAsync(pos.p, script.To.Value.Position, 100) --wait(2)
		s2 = path:GetPointCoordinates()[2] or path:GetPointCoordinates()[1]
		a, b = workspace:FindPartOnRay(Ray.new(pos.p, Vector3.new(0, -6)), r.Parent)
		w = 0
		repeat
			w = w + 1
			if s2 then
				local cf = CFrame.new(pos.p, s2)
				pos = cf * CFrame.new(0, 0, -0.3)
				a, b = workspace:FindPartOnRay(Ray.new(pos.p, Vector3.new(0, -6)), r.Parent)
				p.position = Vector3.new(pos.X, b.Y + 0.3, pos.Z)
				g.cframe = r.Velocity.magnitude > 0.5 and CFrame.new(r.Position, r.Position + r.Velocity) or g.cframe
				if (Vector3.new(r.Position.X, 0, r.Position.Z) - Vector3.new(pos.X, 0, pos.Z)).magnitude > 3 then
					r.CFrame = r.CFrame - r.Position + Vector3.new(pos.X, b.Y + 0.3, pos.Z)
				end
			else
				break
			end
			wait()
		until (r.Position - Vector3.new(s2.X, b.y, s2.Z)).magnitude < 1
			or (r.Position - Vector3.new(s2.X, b.y, s2.Z)).magnitude > 6
			or w > 20
		if script.To.Value and (r.Position - script.To.Value.Position).magnitude < 8 then
			if got(script.To.Value) then
				break
			end
		end
	else
		script.To.Value, rss = workspace.Finish, workspace
		wait()
	end
end
