HahaSamus
|
  |
| Joined: 20 Apr 2012 |
| Total Posts: 11 |
|
|
| 27 Apr 2012 09:07 PM |
I am trying to make a brick randomly rotate. I just can't get it. My script is: while true do Test6.CFrame = CFrame.new(60.5, 11.8, 86.5) * CFrame.angles(Vector3.random) end
Would I need to define what Test6 is? because I only get error messages on 'Angles' it doesn't give me any other error messages other than that. |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 27 Apr 2012 09:31 PM |
Vector3.random isn't defined. You need to do this:
Vector3.new(math.random(),math.random(),math.random())
With the start and end values (Likely 1 - 360 or something). |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2012 11:04 PM |
| You need a "wait()" somewhere in that While true do function. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 27 Apr 2012 11:42 PM |
@thecaptain
It's a loop, not a function. |
|
|
| Report Abuse |
|
|
|
| 28 Apr 2012 12:29 AM |
| Still, You need a "wait()" in it. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 28 Apr 2012 03:03 AM |
You'll need to set a vector3 and continuously add it to the new one. And, you should put a wait() to avoid it crashing your studio.
"Knowledge talks, wisdom listens." |
|
|
| Report Abuse |
|
|
HahaSamus
|
  |
| Joined: 20 Apr 2012 |
| Total Posts: 11 |
|
|
| 28 Apr 2012 09:03 AM |
| Thank you soo much. Everyone. |
|
|
| Report Abuse |
|
|
|
| 28 Apr 2012 09:18 AM |
put a wait() i would sugest wait(0.5) or less |
|
|
| Report Abuse |
|
|
HahaSamus
|
  |
| Joined: 20 Apr 2012 |
| Total Posts: 11 |
|
|
| 28 Apr 2012 08:33 PM |
I figured it out to those that want to know. The way I used was:
function SpinBlock(Spin, PauseTime)
script.Parent.CFrame = CFrame.new(script.Parent.Position) * CFrame.fromEulerAnglesXYZ(Spin, Spin, Spin) wait(PauseTime) end
local XYZ = 0.0;
while true do for i = 0, 9 do SpinBlock(XYZ, 0.1) XYZ = XYZ + 0.1; end; end
Thanks all. |
|
|
| Report Abuse |
|
|
| |
|