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

How to make multiple part doors move?

I have tried using code to make many part doors move when clicked.

wait(4)
workspace.Door1:FindFirstChildWhichIsA("Part").Rotation = Vector3.new(-773.463, 1683.242, 374)

*I dont know the clicked script.

I want to make multiple part doors moved when clicked. Instead, only one part moves.

Can someone find the error and the clicking script?

1 comment

0

Union, PrimaryPart/SetPrimaryPartCFrame, Welding

2 answers

✓ Accepted answer

Models. You want to put every part of the door in a Model (Selete all of them then Ctrl+G), then you'd set the 'PrimaryPart' property of the door the 'base', or the largest part. Then this would be your script:

local MyCFrame = CFrame.new(1,10,100) * CFrame.fromOrientation(90,90,180) --Example CFrame.
Model:SetPrimaryPartCFrame(MyCFrame)

Script for Parts:

local rotationAngle = Vector3.new(10, 10, 10)  -- This is the Vector3 that your parts turn at, so edit this to what you want it to be. 

script.Parent.ClickDetector.MouseClick:Connect(function()
	script.Parent.Parent.a.Rotation = rotationAngle 
	script.Parent.Parent.b.Rotation = rotationAngle 
	script.Parent.Parent.c.Rotation = rotationAngle 
	script.Parent.Parent.d.Rotation = rotationAngle 
	script.Parent.Parent.e.Rotation = rotationAngle 
	script.Parent.Parent.f.Rotation = rotationAngle 
	script.Parent.Parent.g.Rotation = rotationAngle 
	script.Parent.Parent.h.Rotation = rotationAngle 
	script.Parent.Parent.i.Rotation = rotationAngle 
end) 

Basically, put this in a script, and paste that script into each part.

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