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: What's wrong with this?

Previous Thread :: Next Thread 
ZizZazZuz is not online. 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 is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
01 Oct 2011 06:23 PM
script.Parent:Bump()
Report Abuse
SDuke524 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
01 Oct 2011 07:28 PM
And everything is named properly?
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
01 Oct 2011 07:32 PM
Yes.
Report Abuse
SDuke524 is not online. 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 is not online. 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 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
01 Oct 2011 07:36 PM
I belive its :GetChildren() not :getChildren()
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
01 Oct 2011 07:36 PM
Also why are you using AngularVelocity?
Report Abuse
kingmod123 is not online. kingmod123
Joined: 16 May 2009
Total Posts: 699
01 Oct 2011 07:38 PM
Isn't it :IsA() not :isA()?
Report Abuse
ZizZazZuz is not online. 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 is not online. 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 is not online. 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
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