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