ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 01 Oct 2011 03:17 PM |
No output. Doesn't do anything. Help?
function oC() if script.Parent.Parent.Engine.IsGoingUp.Value == true then p = script.Parent.Parent:getChildren() for i = 1, #p do if p[i].Name == "Core" then p[i].Rotater.angularvelocity = p[i].Rotater.angularvelocity * -1 end end mass = 0 for i = 1, #p do if p[i]:isA("BasePart") then mass = mass + p[i]:getMass() end end script.Parent.Parent.Engine.Tension.force = Vector3.new(0, (mass * 197) * 2, 0) script.Parent.Parent.Engine.IsGoingUp.Value = false end end
script.Parent.ClickDetector.MouseClick:connect(oC) |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Oct 2011 07:01 PM |
Please tell us what it's supposed to do...
Also take out that ==true, it's ugly and useless. |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 01 Oct 2011 07:06 PM |
Really? I don't need it?
It's supposed to multiply a set of values by -1, then get the mass of he entire model, multiply it by 197, then multiply that by 2, effecivly reversing the gravitational pull. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Oct 2011 07:13 PM |
No keep the conditional but take out the ==true in it so like
if script.Parent.Parent.Engine.IsGoingUp.Value then
saying
if a==true then
is like saying
"if a is the equivalent of true then"
whereas saying
if a then
is like saying
"if a is true then" |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 01 Oct 2011 07:26 PM |
| Oh, OK. So what did I do wrong? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Oct 2011 07:28 PM |
| And everything is named properly? |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Oct 2011 07:35 PM |
| I don't see anything wrong with it. What are you trying to do this to? |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 01 Oct 2011 07:35 PM |
function oC() if script.Parent.Parent.Engine.IsGoingUp.Value == true then p = script.Parent.Parent:GetChildren() for i = 1, #p do if p[i].Name == "Core" then p[i].Rotater.angularvelocity = p[i].Rotater.angularvelocity * -1 end end mass = 0 for i = 1, #p do if p[i]:isA("BasePart") then mass = mass + p[i]:getMass() end end script.Parent.Parent.Engine.Tension.force = Vector3.new(0, (mass * 197) * 2, 0) script.Parent.Parent.Engine.IsGoingUp.Value = false end end
script.Parent.ClickDetector.MouseClick:connect(oC) |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 01 Oct 2011 07:36 PM |
| I belive its :GetChildren() not :getChildren() |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Oct 2011 07:36 PM |
| Also why are you using AngularVelocity? |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2011 07:38 PM |
| Isn't it :IsA() not :isA()? |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 01 Oct 2011 09:11 PM |
@king Either works @SDuke I want it to spin. Derp. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Oct 2011 10:40 PM |
| BodyGyro would be better in all cases. Also the problem could easily be that 0*(-1)=0 |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 02 Oct 2011 07:49 AM |
| I'd like to stick with BAV, thanks. And it is definitely not 0. It worked before I added the mass part. |
|
|
| Report Abuse |
|
|