function ArrowGuide.new(s)local m=Instance.new("\080\097\114\116")m.Name="\065\114\114\111\119"m.Size=Vector3.new(2,1,5)m.Color=Color3.new(.98823529411765,.003921568627451,.027450980392157)m.CanCollide=false local h=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")h.MeshId="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\049\052\054\053\054\051\052\053"h.Scale=Vector3.new(.2,.4,.2)h.Parent=m m.Position=character.PrimaryPart.Position+Vector3.new(0,character.PrimaryPart.Size.Y+OFFSET,0)local f=Instance.new("\087\101\108\100")f.Part0=m f.Part1=character.PrimaryPart m.Parent=character RunService:BindToRenderStep("\085\112\100\097\116\101\068\105\114\101\099\116\105\111\110",1,function()if s==0 then return end local h=s[1]:FindFirstChild("\067\104\101\099\107\112\111\105\110\116")local f=(m.Position-h.Position).magnitude local S=h for s,I in ipairs(s)do local b=I:FindFirstChild("\072\105\116")if not b or b.Value==false then h=I:FindFirstChild("\067\104\101\099\107\112\111\105\110\116")local s=(m.Position-h.Position).magnitude if s<f then S=h end end end local I=character.PrimaryPart.Position+Vector3.new(0,character.PrimaryPart.Size.Y+OFFSET,0)m.CFrame=CFrame.new(I,S.Position)end)return m end

function ArrowGuide.new(targets)
	local arrow = Instance.new("Part")
	arrow.Name = "Arrow"
	arrow.Size = Vector3.new(2, 1, 5)
	arrow.Color = Color3.new(252/255, 1/255, 7/255) -- Red
	arrow.CanCollide = false
	
	local mesh = Instance.new("SpecialMesh")
	mesh.MeshId = "http://www.roblox.com/asset/?id=14656345" -- Arrow mesh
	mesh.Scale = Vector3.new(0.2, 0.4, 0.2)
	mesh.Parent = arrow
	
	arrow.Position = character.PrimaryPart.Position + Vector3.new(0, character.PrimaryPart.Size.Y + OFFSET, 0)
	
	local arrowWeld = Instance.new("Weld")
	arrowWeld.Part0 = arrow
	arrowWeld.Part1 = character.PrimaryPart
	
	arrow.Parent = character
	
	RunService:BindToRenderStep("UpdateDirection", 1, function()
		if targets == 0 then return end
	
		local checkpoint = targets[1]:FindFirstChild("Checkpoint")
		local closestDistance = (arrow.Position - checkpoint.Position).magnitude
		local closestTarget = checkpoint
	
		-- Find nearest target
		for _, target in ipairs(targets) do
			local hit = target:FindFirstChild("Hit")
			if (not hit or hit.Value == false) then
				checkpoint = target:FindFirstChild("Checkpoint")
				local distance = (arrow.Position - checkpoint.Position).magnitude
				if distance < closestDistance then
					closestTarget = checkpoint
				end
			end
		end
	
		-- Point arrow at nearest target
		local newPos = character.PrimaryPart.Position + Vector3.new(0, character.PrimaryPart.Size.Y + OFFSET, 0)
		arrow.CFrame = CFrame.new(newPos, closestTarget.Position)
	end)
	
	return arrow
end -- ArrowGuide.new()