0

# How can I make Theatre Curtains open and close like in a real theatre?

How can you make a theatre curtain? Like in shows?

1
nate890 495
8 years ago
function moveCurtains(curtain1, curtain2, v, n, t)
for i = 1, n do
curtain1.CFrame = curtain1.CFrame + v
curtain2.CFrame = curtain2.CFrame - v
wait(t)
end
end

--Open curtains
moveCurtains(
workspace.CurtainOne, workspace.CurtainTwo,
Vector3.new(0.1, 0, 0), 100, 0.03 -- 0.1 * 100 = 10 studs
)

--Close curtains
moveCurtains(
workspace.CurtainOne, workspace.CurtainTwo,
-Vector3.new(0.1, 0, 0), 100, 0.03 -- 0.1 * 100 = 10 studs
)


Might need to play around with it. The t parameter is for the time between each small movement, defined by the v parameter and does this small movement 100 times, defined by the n parameter. t is currently 0.03 and is as small as the delay (between small movements) can get. It's as "small" as the wait function gets. If you wanted to make the curtains move more quickly apart but still move 10 studs out, you would do something like this,

moveCurtains(
workspace.CurtainOne, workspace.CurtainTwo,
Vector3.new(0.2, 0, 0), 50, 0.03 -- 0.2 * 50 = 10 studs (at twice the pace)
)


Hope I made it so you can understand how this works as it can be a bit confusing :)