You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve?
I want to achive something that looks like this
- What is the issue?
Im not sure how to do this as my attempt looks like this:
It work but not how I want it to it paste loads of parts etc.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local PathfindingService = game:GetService("PathfindingService")
local PathfindingServiceCreatePath = PathfindingService:CreatePath()
local AlreadyPro = workspace.AlreadyPro
PathfindingServiceCreatePath:ComputeAsync(AlreadyPro.HumanoidRootPart.Position, workspace.End.Position)
local PathfindingServiceCreatePathGetWaypoints = PathfindingServiceCreatePath:GetWaypoints()
function Function(Number, Part, Part2)
local Folder = Instance.new("Folder")
Folder.Name = "Part" .. Folder.Name
Folder.Parent = workspace
local Parts = {}
for Number2 = 0, Number do
local Vector = Part.Position + (Part2.Position - Part.Position).Unit * Number2 * (Part.Position - Part2.Position).Magnitude / Number
--[[
local Part3 = Instance.new("Part")
Part3.Position = Vector
Part3.Anchored = true
Part3.Size = Vector3.new(1, 1, 1)
Part3.Parent = Folder
--]]
Parts[#Parts + 1] = Vector
end
for Number3 = 1, #Parts do
if Parts[Number3 + 1] ~= nil then
local Part4 = Instance.new("Part")
Part4.CFrame = CFrame.new((Parts[Number3] + Parts[Number3 + 1]) / 2, Parts[Number3 + 1])
Part4.Anchored = true
Part4.Size = Vector3.new(1, 1, (Parts[Number3] - Parts[Number3 + 1]).Magnitude)
Part4.Parent = workspace
end
end
end
for i, waypoint in pairs(PathfindingServiceCreatePathGetWaypoints) do
Function(i, AlreadyPro.HumanoidRootPart, workspace.End)
end
That is my code I want to know how to turn it into an efficient one like the mc pathfinding line.
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Any help would be nice