So, my block of code looks like this:

local ElevatorParts = script.Parent.Parent:GetChildren()
script.Parent.ClickDetector.MouseClick:connect(function()
	if script.Parent.Parent.FloorNumber.Value < 2 then
		if script.Parent.Parent.InUse.Value == false then
			script.Parent.Parent.InUse.Value = true
			for _,v in pairs(script.Parent.Parent:GetChildren()) do
				if v.ClassName == "Part" then
					v.CFrame = v.CFrame * CFrame.new(v.Position.X, v.Position.Y + 1, v.Position.Z)
				end
			end
		end
	end
end)

The expected output is the elevator's parts moving up one unit on the y axis, but instead turns into a black hole.

2 comments

0

Because you're setting a CFrame to the current CFrame plus the CFrame of the part plus 1 of the Y Axis. To fix this, just change "* CFrame.new(v.Position.X..." with "*CFrame.new(0,1,0)"

0

Whoa, thanks mate!