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

How to make a for loop execute a certain amount of times?

Asked by
xAtom_ik 574 Moderation Voter
8 years ago

I am trying to make rotating text on a screengui. The text will do a full 360 turn and be back normal, however, I am using a for loop and can't make it execute a certain number of times.

Attempt:

for I in 360 do
    wm.Rotation = wm.Rotation + 1 -- wm is WelcomeMsg, located in the same directory
end

Can I please have some help?

1 answer

Log in to vote
1
Answered by 8 years ago

Here we can see here you are trying to rotate the part like this: You has 2 error, your first was when you trying to use for i = 1, 360 do your second was at line 3 with rotation you forgot too put "Vector3"

for i = 1, 360 do
    wait(0.1)
    wm.Rotation = wm.Rotation + i
end
1
It works anyway, Thanks! xAtom_ik 574 — 8y
0
You're welcome ! XToonLinkX123 580 — 8y
0
you've made an slight error xToon. He was trying to set a GUI rotation, and not a 3d model rotation or cframe davness 376 — 8y
Ad

Answer this question