generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: For Loop Making a Part Ring

Previous Thread :: Next Thread 
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
08 Jul 2012 10:10 PM
I, too would like to know this.
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
08 Jul 2012 10:18 PM
WHy do I have a Feeling I know what this is for...
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
08 Jul 2012 10:20 PM
A shield for Script Builder? XD.
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
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
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
08 Jul 2012 10:23 PM
500 Posts Yay
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
08 Jul 2012 10:24 PM
I have a feeling it's for more than a "Script Builder"...
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image