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: Body force & KeyDown not working

Previous Thread :: Next Thread 
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:20 PM
mouse.KeyDown:connect(function(Key)
if Key == "r" then
game.Workspace.Car.thrust.BodyForce.force = Vector3.new (-85000,0,0)
else
game.Workspace.Car.thrust.BodyVelocity.maxForce.X = 0
end
end)



`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
DarknessUbe is not online. DarknessUbe
Joined: 06 Feb 2011
Total Posts: 4
18 Jul 2014 08:21 PM
FIX IT YOURSELF DUMBASS
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:21 PM
Woops forgot to explain. its not working. its not changing the BodyForce's value.



`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
18 Jul 2014 08:21 PM
Did you define Mouse?

Is it in a LocalScript?
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:22 PM
@Darkness

Thanks sooo much you really helped me out.

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:23 PM
Yes it is in a LocalScript but let me defin ethe mouse...

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:24 PM
Like this?

mouse.KeyDown:connect(function(Key)
Mouse = Player:GetMouse()
if Key == "r" then
game.Workspace.Car.thrust.BodyForce.force = Vector3.new (-85000,0,0)
else
game.Workspace.Car.thrust.BodyVelocity.maxForce.X = 0
end
end)



`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:25 PM
Actually no I don't think that's right... This?


mouse = Player:GetMouse()

mouse.KeyDown:connect(function(Key)
if Key == "r" then
game.Workspace.Car.thrust.BodyForce.force = Vector3.new (-85000,0,0)
else
game.Workspace.Car.thrust.BodyVelocity.maxForce.X = 0
end
end)



`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
18 Jul 2014 08:26 PM
I was about to tell you that. :3
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
18 Jul 2014 08:26 PM
Is Player declared?
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:26 PM
Its... Still not working.

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:27 PM
Player = Game.Players.LocalPlayer?

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
18 Jul 2014 08:27 PM
Yeah.
Report Abuse
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
18 Jul 2014 08:27 PM
mouse = game.Players.LocalPlayer:GetMouse()

mouse.KeyDown:connect(function(Key)
if Key == "r" then
game.Workspace.Car.thrust.BodyForce.force = Vector3.new (-85000,0,0)
else
game.Workspace.Car.thrust.BodyVelocity.maxForce.X = 0
end
end)
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:29 PM
@samy
@blupo

Still not working. :/

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
18 Jul 2014 08:30 PM
Hmm..

Just for insurance, change the Key to 114.
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:30 PM
What's 114?

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
18 Jul 2014 08:31 PM
114 is the letter "R"
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:31 PM
In ""?

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
18 Jul 2014 08:31 PM
Just the number.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
18 Jul 2014 08:31 PM
I thought you knew that the X, Y, and Z properties were read only. you can't change them alone in a script or it errors. Make a variable for them then try.
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:32 PM
@Blupo still not working.

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:33 PM
@Accomplish
No errors

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
18 Jul 2014 08:33 PM
Nothing in the output.

`Time keeps moving on and on and on, soon we'll all be gone. - Blink 182, Man Overboard`
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
18 Jul 2014 08:34 PM
k.
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