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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Golf-like script

Previous Thread :: Next Thread 
TheMesgi is not online. TheMesgi
Joined: 03 Mar 2012
Total Posts: 360
12 Jul 2016 02:17 AM
So the script is supposed to propel a ball in the direction you click, but for some reason, it adds the BodyPosition and doesn't set any properties
here is the part of the script

mouse.Button1Down:connect(function()
local position = mouse.Hit
local vev = Instance.new("BodyPosition")
vev.Parent = ball
vev.D = 0
local distance = (ball.Position - position).magnitude
vev.P = distance*10000
vev.MaxForce = Vector3.new(vev.P/20, vev.P/20, vev.P/20)
wait(0.1)
vev:Destroy()
end)

Report Abuse
GraphicsSettings is not online. GraphicsSettings
Joined: 12 Sep 2013
Total Posts: 2883
12 Jul 2016 02:20 AM
Setting properties for things like this is kind of weird, you have to set it in lower case, so:

mouse.Button1Down:connect(function()
local position = mouse.Hit
local vev = Instance.new("BodyPosition")
vev.Parent = ball
vev.D = 0
local distance = (ball.Position - position).magnitude
vev.P = distance*10000
vev.maxforce = Vector3.new(vev.P/20, vev.P/20, vev.P/20)
wait(0.1)
vev:Destroy()
end)
Report Abuse
TheMesgi is not online. TheMesgi
Joined: 03 Mar 2012
Total Posts: 360
12 Jul 2016 02:29 AM
yours didn't work either and i couldn't see any changes, did you type it right?
Report Abuse
TheMesgi is not online. TheMesgi
Joined: 03 Mar 2012
Total Posts: 360
12 Jul 2016 02:48 AM
yeah the one you posted is exactly the same
Report Abuse
GraphicsSettings is not online. GraphicsSettings
Joined: 12 Sep 2013
Total Posts: 2883
12 Jul 2016 03:59 AM
No.

vev.MaxForce = Vector3.new(vev.P/20, vev.P/20, vev.P/20)

went to...

vev.maxforce = Vector3.new(vev.P/20, vev.P/20, vev.P/20)
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
12 Jul 2016 05:37 AM
"maxforce" needs to be MaxForce. Its a property. You need to spell it the way roblox does.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
12 Jul 2016 07:52 AM
The problem might be that here:
(ball.Position - position).magnitude
You're subtracting a CFrame(position), from a Vector3(ball.Position). Change this line
local position = mouse.Hit to local position = mouse.Hit.p

Adding .p to a CFrame get's the first 3 components of it as a V3.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
12 Jul 2016 07:52 AM
And ya, ignore graphics. Properties always need to have proper capitalization.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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