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: BodyForce

Previous Thread :: Next Thread 
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
19 Apr 2013 06:49 PM
19:47:13.321 - X cannot be assigned to
19:47:13.322 - Script "Workspace.Jeep.VehicleSeat.vehicleMove", Line 6
19:47:13.322 - stack end
19:47:13.323 - Disconnected event because of exception



speed = 60000.000

function throC(property)
if property == "Throttle" then
if script.Parent.Throttle == 1 then
script.Parent.BodyForce.force.X = speed
else
script.Parent.BodyForce.force.X = -speed
end
end
end



script.Parent.Changed:connect(throC)


Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
19 Apr 2013 07:01 PM
bbump
Report Abuse
wafles26122 is not online. wafles26122
Joined: 14 Jun 2010
Total Posts: 958
19 Apr 2013 07:12 PM
I'm not sure if this will work, but try this:


speed = 60000.000

function throC(property)
if property == "Throttle" then
if script.Parent.Throttle == 1 then
force = script.Parent.BodyForce.force
force.X = speed
else
force = script.Parent.BodyForce.force
force.X = speed * -1
end
end
end



script.Parent.Changed:connect(throC)
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
19 Apr 2013 07:28 PM
got this error

20:28:00.451 - X cannot be assigned to
20:28:00.452 - Script "Workspace.Jeep.VehicleSeat.vehicleMove", Line 30
20:28:00.453 - stack end
20:28:00.453 - Disconnected event because of exception
Report Abuse
wafles26122 is not online. wafles26122
Joined: 14 Jun 2010
Total Posts: 958
19 Apr 2013 07:31 PM
Maybe this?


speed = 60000.000

function throC(property)
if property == "Throttle" then
if script.Parent.Throttle == 1 then
bforce = script.Parent.BodyForce
bforce.force = Vector3.new(speed, bforce.force.Y, bforce.force.Z)
else
bforce = script.Parent.BodyForce
bforce.force = Vector3.new((speed * -1), bforce.force.Y, bforce.force.Z)
end
end
end



script.Parent.Changed:connect(throC)
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
19 Apr 2013 07:40 PM
It's telling u that X cannot be assigned to, because .x cannot be assigned to. But u may make a Vector3, with a .x in it (as well as a .y & .z), and stuuf that into any other Vector3.

Looks like Waffles did that, but I have never seen .X, before.

Bri
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
19 Apr 2013 07:42 PM
Looks like

"speed = 60000.000

function throC(property)
if property == "Throttle" then
if script.Parent.Throttle == 1 then
bforce = script.Parent.BodyForce
bforce.force = Vector3.new(speed, bforce.force.Y, bforce.force.Z)
else
bforce = script.Parent.BodyForce
bforce.force = Vector3.new((speed * -1), bforce.force.Y, bforce.force.Z)
end
end
end



script.Parent.Changed:connect(throC)"


works.
thanks
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