Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trying to make a morph that spawns 7 bodyguards, but only 1 spawns (?)

As the title says, whenever you morph Into a certain troll, 7 bodyguards appear, the problem Is that only 1 appears

script:

local Pathfinding = game:GetService("PathfindingService")
local EpicGuy

if script.Parent.Parent == game.Workspace then
	script.Parent.Humanoid:UnequipTools()
	wait(0.5)
	for i=0, 7 do
		EpicGuy = game:GetService("ReplicatedStorage")["Ally NPCS"]["Mafia Minion"]:Clone()
		EpicGuy.Parent = script.Parent.Minions
		EpicGuy.Torso.CFrame = script.Parent.Torso.CFrame
		while wait() do
			local Path = Pathfinding:CreatePath()
			Path:ComputeAsync(EpicGuy.Torso.Position,script.Parent.Torso.Position)
			if Path.Status == Enum.PathStatus.Success then
				local Waypoints = Path:GetWaypoints()

				for i,v in pairs(Waypoints) do
					local Waypoint = Instance.new("Part",game.Workspace)
					Waypoint.Position = v.Position
					Waypoint.Anchored = true
					Waypoint.CanCollide = false
					Waypoint.Transparency = 1
					EpicGuy.Humanoid:MoveTo(Waypoint.Position)
					EpicGuy.Humanoid.MoveToFinished:Wait()
					game:GetService("Debris"):AddItem(Waypoint,0)
				end
			end
		end
		wait()
	end
end

1 answer

  1. Never Ever use Torso. Torso Is used for R6. R6 Is never used on people anymore so change torso to HumanoidRootPart since its on both.

  2. I think you dont need while wait() for the for i loop.

  3. Check the output for problems.

  4. If none works, then add local num = 0. Then change for i loop into repeat. Then put num = num + 1 then beside until put num == 7 and after the repeat loop do num = 0

2 comments

0

The morph (and the bodyguards) are literally R6

0

I guess so. Did the rest work?

This discussion is preserved as it was. New answers, comments, and votes are closed.