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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
JoeMonnie is not online. JoeMonnie
Joined: 17 Sep 2011
Total Posts: 407
21 Oct 2014 09:54 PM
I'm going to say this right away, I know almost nothing about scripting, so sorry if I ask dumb questions :(

What I need is a block that spins around in circles. I could use a motor, but I have nothing but problems with those. The block has to be stationary and not move around, but spin around. I don't know if that's easy, but it seems like it would be. Thanks for anyone who helps.

Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
21 Oct 2014 09:55 PM
CFrame.Angles() is your friend

guise i have a siggy
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Oct 2014 09:56 PM
local offset = 10; -- studs (length from origin)
local origin = system.Position;
local part = blah;

for angle = 1, 360 do
part.CFrame = CFrame.new(origin) * CFrame.Angles(0, math.rad(angle), 0) * CFrame.new(0, 0, offset);
wait()
end
Report Abuse
iiUltimate is not online. iiUltimate
Joined: 29 Mar 2012
Total Posts: 3694
21 Oct 2014 09:56 PM
brick=game.Workspace:findFirstChild("BrickNameHere")
while wait() do
brick.CFrame=CFrame.Angles(brick.Rotation.X+1,brick.Rotation.Y,brick.Rotation.Z)
end

I doubt this will work, but I"m still a novice scripter
Report Abuse
JoeMonnie is not online. JoeMonnie
Joined: 17 Sep 2011
Total Posts: 407
21 Oct 2014 10:00 PM
Thanks for the help everyone, but I want to work with iiUltimate.

Seems like it works, but it's spinning way too fast. Any way to slow it down?
Report Abuse
JoeMonnie is not online. JoeMonnie
Joined: 17 Sep 2011
Total Posts: 407
21 Oct 2014 10:02 PM
Also, it looks like the block doesn't stay in place. It changes it's postition to 0, 0, 0
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
21 Oct 2014 10:03 PM
local spinBrick = coroutine.wrap(function(brick)
while wait() do
brick.CFrame = brick.CFrame*CFrame.Angles(0,0.5,0);
end;
end);
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Oct 2014 10:04 PM
His spins in circles, and he is using incorrect arguments for Angles (and a very bad way to do it, no offense) I assumed you wanted it to orbit. But to spin in place it would be best to do this:

while true do
part.CFrame = part.CFrame * CFrame.Angles(0, math.pi/180, 0)
wait()
end
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
21 Oct 2014 10:05 PM
put this in the brick

local degrees = 10

while true do
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0, math.rad(degrees), 0)
wait()
end


not the most efficient but meh

guise i have a siggy
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
21 Oct 2014 10:05 PM
ninja'd
qq

guise i have a siggy
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
21 Oct 2014 10:05 PM
[ Content Deleted ]
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
21 Oct 2014 10:05 PM
Guys guys guys...

No no no no no.

Ew CFrame.Angles()

Use a simpler method, which is also mathematically easier,

local p = script.Parent

while wait() do
p.CFrame = p.CFrame * CFrame.fromAxisAngle(Vector3.new(0,1,0), math.rad(1))
end

Change math.rad(1) to a higher number to make it go faster. Also, this will keep it in the same place.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Oct 2014 10:08 PM
Out of curiosity, which is faster?
Report Abuse
JoeMonnie is not online. JoeMonnie
Joined: 17 Sep 2011
Total Posts: 407
21 Oct 2014 10:08 PM
@DrMathatica (I think it's spelt...)
Works, does just what I want! I can finally stop using motors. I've grown to really hate those...

Wow, so many people wanting to help. Thanks everyone who posted here.
Report Abuse
JoeMonnie is not online. JoeMonnie
Joined: 17 Sep 2011
Total Posts: 407
21 Oct 2014 10:09 PM
@cntkillme

I didn't test yours. Want me to though?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Oct 2014 10:10 PM
They both will do the same thing.
Report Abuse
JoeMonnie is not online. JoeMonnie
Joined: 17 Sep 2011
Total Posts: 407
21 Oct 2014 10:10 PM
oh it's DrMathematica sorry
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
21 Oct 2014 10:13 PM
[ Content Deleted ]
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Oct 2014 10:14 PM
mur, stop being so inefficient. Using division multiple times is completely unnecessary.
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
21 Oct 2014 10:16 PM
[ Content Deleted ]
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Oct 2014 10:17 PM
and the %1
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