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

How to make a brick move with a script?

Asked by 10 years ago

Could somebody tell me what to write to make a brick move when ordered? I'm a newbie at scripting...

3 answers

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago
for i = 1,10 do
Workspace.Part.Position = Workspace.Part.Position  + Vector3.new(i,0,0)
wait(0.5)
end

This will move it 10 studs on the x axis.

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

Correction:

for i = 1,20 do
script.Parent.Position = vector3.new(i, 0, 0)
wait(0.5)
end

This is an easier way, paste it into the brick. Or you can do this to have it run by it not being in the script.

for i,20 do
game.Workspace.BRICKNAME.Position = vector3.new(i, 0, 0)
wait(0.5)
end
Log in to vote
0
Answered by
istiyak 13
10 years ago

You should of checked the wiki

Answer this question