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

Why won't this code work?

Asked by
Avectus 120
9 years ago

I'm trying to make 'Jericho1' move smoothly to a position, but when I use the code below it jumps to the last digit.

for i = 1, 50 do
   Jericho1:SetPrimaryPartCFrame(CFrame.new(-31.209-i, 3.451, -126.11))
end

Could someone please tell me what's wrong and/or what I need to do to fix this?

Thanks.

0
Please make your title relevant to your question. Goulstem 8144 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

The code itself is fine, although you forgot to add a wait. It should be:

for i = 1, 50 do Jericho1:SetPrimaryPartCFrame(CFrame.new(-31.209-i, 3.451, -126.11)) wait() end

Ad

Answer this question