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

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

Asked by 10 years ago

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

3 answers

Log in to vote
1
Answered by
nate890 495 Moderation Voter
10 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 :)

Ad
Log in to vote
0
Answered by 10 years ago

You could try loop cframing a block to close/open the curtains.

Log in to vote
0
Answered by 4 years ago

BABY HOUR

Answer this question