Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make multiple part doors move?

Asked by
Zikelah 20
5 years ago
Edited 5 years ago

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?

0
Union, PrimaryPart/SetPrimaryPartCFrame, Welding ScriptGuider 5640 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
Ad
Log in to vote
0
Answered by 5 years ago

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.

Answer this question