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 » Scripters
Home Search
 

Re: Is there a better equation for accuracy?

Previous Thread :: Next Thread 
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
24 Jun 2015 05:01 PM
Most things I do scripting-wise are really inefficient, but this has to be the worst:

local Randomization = 100 - Accuracy.Value
if Randomization < 0 then Randomization = 0 end
local Rand = (Randomization/Distance) --?!?!?!?! wat do i do!?!?
local EndPoint = EndPoint + Vector3.new(math.random(-Rand,Rand),math.random(-Rand,Rand),math.random(-Rand,Rand))


My current equation of the studs off for accuracy is (100% - Accuracy) / Distance, which doesn't work the best. I know there's a better way to do this, but idk what it is.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
24 Jun 2015 05:42 PM
am currently doing

pos = (mouse.Hit.p - gun.Barrel.Position).unit * 10000
acc = (100 - acc) / 10 --10 and not 100 cos there needs to be more spread over longer distances
pos = pos + AccuracyStuff that u did (math.random(-acc, acc))

"My Life is going Good... but..."
Report Abuse
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
24 Jun 2015 05:50 PM
yes, but then it sprays like crazy when the mouse points at a spot closer to the player
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
24 Jun 2015 07:27 PM
lol... what point of
(mouse.Hit.p - gun.Barrel.Position).unit
do u not understand? :/
.unit changes it to units, then u multiply by ur own distance :P

"My Life is going Good... but..."
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