function ArrowGuide.new(x)local t=Instance.new("\080\097\114\116")t.Name="\065\114\114\111\119"t.Size=Vector3.new(2,1,5)t.Color=Color3.new(.98823529411765,.003921568627451,.027450980392157)t.CanCollide=false local Z=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")Z.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"Z.Scale=Vector3.new(.2,.4,.2)Z.Parent=t t.Position=character.PrimaryPart.Position+Vector3.new(0,character.PrimaryPart.Size.Y+OFFSET,0)local o=Instance.new("\087\101\108\100")o.Part0=t o.Part1=character.PrimaryPart t.Parent=character RunService:BindToRenderStep("\085\112\100\097\116\101\068\105\114\101\099\116\105\111\110",1,function()if x==0 then return end local Z=x[1]:FindFirstChild("\067\104\101\099\107\112\111\105\110\116")local o=(t.Position-Z.Position).magnitude local b=Z for x,V in ipairs(x)do local y=V:FindFirstChild("\072\105\116")if not y or y.Value==false then Z=V:FindFirstChild("\067\104\101\099\107\112\111\105\110\116")local x=(t.Position-Z.Position).magnitude if x<o then b=Z end end end local V=character.PrimaryPart.Position+Vector3.new(0,character.PrimaryPart.Size.Y+OFFSET,0)t.CFrame=CFrame.new(V,b.Position)end)return t end
-- ================================================================================
-- PUBLIC FUNCTIONS
-- ================================================================================
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()
