So I'm trying to make a thing where you click a button things go down and a humanoid comes up from the ground. The problem is making the humanoid rise from the ground, I just keep getting errors. My code

function onClicked()
	local mesa = script.Parent.Parent.Parent.MEsAv2
	local sound = script.Parent.FEMUR
	sound:Play()
	local stand = script.Parent.Parent.Parent.Breaker.Stand
	local stand1 = script.Parent.Parent.Parent.Breaker.Pressure
	wait(17)
	stand.Position = stand.Position + Vector3.new(0, -0.6, 0)
	stand1.Position = stand1.Position + Vector3.new(0, -0.6, 0)
	wait(44)
	local old = script.Parent.Parent.Parent.Dummy
	repeat
		old:SetPrimaryPartCFrame(CFrame.new(old.PrimaryPart.Position, 0, 0.25, 0))
	until old.Head.Position == Vector3.new(-253.597, 4.55, 13.381)
	for i,v in pairs(old:GetChildren()) do
		if v:IsA("BasePart") then
			v.CanCollide = true
		end
	end
	old.Humanoid.WalkToPart = mesa.HumanoidRootPart
	wait(5)
	mesa:BreakJoints()
end 

script.Parent.ClickDetector.MouseClick:connect(onClicked)

The error happens here

repeat
	old:SetPrimaryPartCFrame(CFrame.new(old.PrimaryPart.Position, 0, 0.25, 0))
until old.Head.Position == Vector3.new(-253.597, 4.55, 13.381)

1 comment

0

What error?