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

How do I make it so that when you press a button/brick multiple bricks move?

I want a script that allows me you press a brick and it either makes the brick go up or down. Like an elevator, you either press the down brick to go down or the up brick to go up. But I need multiple bricks doing that. If you don't understand, PM over ROBLOX.

2 answers

function Clicked()
local ran = math.random(1,2)
if ran==1 then
for i = 1,30,0.5 do
wait()
script.Parent.CFrame = CFrame.new(script.Parent.CFrame.p+Vector3.new(0,0.1,0)))
else
for o = 1,30,0.5 do
wait()
script.Parent.CFrame = CFrame.new(script.Parent.CFrame.p-Vector3.new(0,0.1,0)))
end
script.Parent.ClickDetector.Clicked:connect(Clicked)

Make sure you inserted a ClickDetector in the brick that has the script and that you want to move.

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