|
| 08 Jul 2012 10:09 PM |
Hello, While recently trying to script, I got a fatal error! I need a for loop to make parts not only face me, but go in a circle around me about 2 studs or 3 studs away.
How would I do this using math.rad?
Any wiki threds? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:10 PM |
| I, too would like to know this. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:17 PM |
w1 = Instance.new("Weld") w1.Parent = Workspace.PLAYERNAME.Torso w1.Part0 = w1.Parent w1.Part1 = Workspace.PARTNAME w2.C1 = CFrame.new(-3,0,0)
w2 = Instance.new("Weld") w2.Parent = Workspace.PLAYERNAME.Torso w2.Part0 = w2.Parent w2.Part1 = Workspace.PARTNAME2 w2.C1 = CFrame.new(3,0,0)
for x = 0,1,0.1 do w1.C1 = CFrame.new(w1.C1) * CFrame.Angles(0.1,0,0) w2.C1 = CFrame.new(w2.C1) * CFrame.Angles(0.1,0,0) wait(0.1) end
I think that that would make the 2 parts rotate around you. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:18 PM |
| WHy do I have a Feeling I know what this is for... |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:20 PM |
| A shield for Script Builder? XD. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:20 PM |
Idk.
I made a mistake.
w1 = Instance.new("Weld") w1.Parent = Workspace.Player.Torso w1.Part0 = w1.Parent w1.Part1 = Workspace.Brick1 w1.C1 = CFrame.new(-3,0,0)
w2 = Instance.new("Weld") w2.Parent = Workspace.Player.Torso w2.Part0 = w2.Parent w2.Part1 = Workspace.Brick2 w2.C1 = CFrame.new(3,0,0)
for x = 0,1,0.1 do w1.C1 = CFrame.new(w1.C1) * CFrame.Angles(0.1,0,0) w2.C1 = CFrame.new(w2.C1) * CFrame.Angles(0.1,0,0) wait(0.1) end
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:21 PM |
for i=20,360,20 do PART.CFrame = CFrame.new(Vector3.new(3*math.sin(math.rad(i)),0,3*math.cos(math.rad(i))),TORSO.CFrame.p)+TORSO.CFrame.p end |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:22 PM |
Forget that script. :P It doesn't turn the right way.
I will make a new one. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Jul 2012 10:24 PM |
| I have a feeling it's for more than a "Script Builder"... |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2012 10:25 PM |
wait(10) w1 = Instance.new("Weld") w1.Parent = Workspace.Player.Torso w1.Part0 = w1.Parent w1.Part1 = Workspace.Brick1 w1.C1 = CFrame.new(-5,0,0)
w2 = Instance.new("Weld") w2.Parent = Workspace.Player.Torso w2.Part0 = w2.Parent w2.Part1 = Workspace.Brick2 w2.C1 = CFrame.new(5,0,0)
for x = 0,100,0.1 do w1.C1 = w1.C1 * CFrame.Angles(0,0.1,0) w2.C1 = w2.C1 * CFrame.Angles(0,0.1,0) wait(0.1) end
That works. Tested it 100%. |
|
|
| Report Abuse |
|
|