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

How would I combine this with a for loop?

Asked by 8 years ago
game.Workspace.Player.Torso.CFrame = game.Workspace.Player.Torso.CFrame*CFrame.Angles(math.rad(0),0.1,0)

I want to make it so the player spins every second by 0.01. Sorry for the unclear explanation, anyway the script I posted is working, but I cannot figure out how to make it work with a for loop.

1 answer

Log in to vote
0
Answered by 8 years ago
local a = 200 -- loops

for num, a do -- num is the current loop number it's on and then a is the number of loops
    game.Workspace.Player.Torso.CFrame = game.Workspace.Player.Torso.CFrame*CFrame.Angles(math.rad(0),0.1,0)--your code
    wait(.01)
end --ends it all
Ad

Answer this question