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

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

Asked by
Swabb 0
10 years ago

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

Log in to vote
0
Answered by 10 years ago
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.

Ad
Log in to vote
-1
Answered by
Zwabb 0
10 years ago

you tell it to give birth to a brick house `

Answer this question