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

How to make a brick move another brick

Asked by
Yeevivor4 155
10 years ago

Hello, I always wanted to learn how to make a script where it makes a brick move another brick.

It is like how a regen button regenerates bricks. I've always wanted to learn how it worked.

Thanks for reading.

1
Your question is hard to understand XD Can you rephrase it please ConnorVIII 448 — 10y

2 answers

Log in to vote
1
Answered by
Damo999 182
10 years ago

He mean this how can he can he step on a brick and then make another part in the game move.

To do this he would need to add two brick to the game name one of the brick something like ham once he has done this he will need to add a script to the brick that's name is not ham and add this script.

move = script.Parent.Parent.ham -- name that variable whatever you want 
function onTouched(hit)
move.CFrame = CFrame.new(0,0,1)
end
script.Parent.Touched:connect(onTouched)
Ad
Log in to vote
0
Answered by 10 years ago

Please up my rep! Some trollers have downed it but I am just trying to help

I believe what happens is that you make a script inside a model that contains the model and the regen button. So it would be like

Workspace
    Clone Model
        Regen Script (script)
        Regen Button (part) 
        Tank Model (Model full of parts)

The regen script would identify the button and model.

button = script.Parent.Regen_Button
tank = script.Parent.Tank_Model

Then you would make a function and it regen the model. (this is basic guidelines, don't expect it to work if you copy and paste)

function clonemodel ()
for tank, v in pairs do
part:clone()
end
end



button.Touched:connect(clonemodel)

Answer this question