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

How would I make this vector start at (50,0,0) rather then (1,0,0) ?

Asked by 7 years ago
How would I make it so that it can start at 50,0,0 and move 1 increment as this makes it start at 1,0,0

for i = 1, 50 do workspace.Part.CFrame = CFrame.new(i, 0,0) wait(1) end

1 answer

Log in to vote
0
Answered by 7 years ago

You have two options here:

Option 1:

for i = 1, 50 do
    workspace.Part.CFrame = CFrame.new(51 - i, 0, 0)
    wait(1)
end

Option 2:

for i = 50, 1, -1 do --Note the third number. This is the increment and is optional (defaults to 1)
    workspace.Part.CFrame = CFrame.new(i, 0, 0)
    wait(1)
end
0
He wants to increment not de-increment.(From what I can tell) Thetacah 712 — 7y
0
He previously asked a question involving incrementation, and the wording also implies decrementation. SwardGames 325 — 7y
0
Both is good but how do I get increment? ZackVIII 10 — 7y
0
for VAR = START, END, INCREMENT do creates a variable called var which starts at START and whose value is increased by INCREMENT until END is SwardGames 325 — 7y
Ad

Answer this question