cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 01:18 AM |
My game is actually going pretty good (http://www.roblox.com/Paintballing-Beta-place?id=102529137) and all the guns are doing perfectly well, except the shotgun.
It works and shoots multiple bullets, but how would I go about making the spread wider the farther you are. I was thinking: local RPos = Vector3.new(math.random(-3, 3), math.random(-2, 2), math.random(-3, 3))
local Ray = Ray.new(Tool.Handle.Position + RPos, (Velocity - (Tool.Handle.Position)).unit * 300) and local Ray = Ray.new(Tool.Handle.Position, (Velocity + RPos - (Tool.Handle.Position)).unit * 300)
But none of them seem to actually do it like I want it, any suggestions? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 01:38 AM |
| Oysi the math wiz comes to the recue |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 02:09 AM |
I didn't necessarily use your way, but you gave me the idea:
local RPos = Vector3.new(math.random(-45, 45), math.random(-45, 45), math.random(-45, 45)) local Ray = Ray.new(Tool.Handle.Position, ((Velocity - (Tool.Handle.Position)).unit * 300) + RPos)
Now it's working, thank you for your brainz |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 09:34 PM |
| It's actually better with a lower random, I think I'm using like: -35->35 for X/Z and -10->10 for Y. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 09:35 PM |
O_o I bumped it? It was at the first page before I commented... ROBLOX! |
|
|
| Report Abuse |
|
|
oxcool1
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15444 |
|
|
| 29 Aug 2013 09:35 PM |
| help request 2 scripting helpers next time |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 09:39 PM |
| It was more of a "is this a good way to..." |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2013 09:40 PM |
"It was more of a "is this a good way to..."" Didn't you flame someone not too long ago for saying the same thing? Wow. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 09:43 PM |
| @Absolute, why do you have me all of a sudden? Not only on this thread... |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2013 09:53 PM |
| Because I'm constantly accused of being "excessively hostile", yet I see you (and others) get away with being harsh on a daily basis. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Aug 2013 09:54 PM |
Oh you think I'm getting away with it? http://www.roblox.com/Forum/ShowPost.aspx?PostID=110614906 |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2013 01:57 AM |
Cnt, he was specifically talking about this sub-forum.. Not scripting helpers which as of late doesn't help at all although that is OT..
Back on topic the way you decided is a fine way to do it, good luck. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 30 Aug 2013 02:01 AM |
| Oh, I don't see anyone complaining about him? |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2013 02:04 AM |
| The truth of his statement in that regard (about not being able to get away with being overly aggressive) is something I have not seen. But, then again maybe I just do not look at the threads that he acts that way on. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 30 Aug 2013 09:56 AM |
"This is a very basic help request, and yes, cnt is an ignorant hypocritical cnt." This is not even a help request, I'm asking if that way would work andw hy it was giving me problems if everything was fine.
And how am I a hypocrite? |
|
|
| Report Abuse |
|
|
oxcool1
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15444 |
|
|
| 30 Aug 2013 10:04 AM |
just use scripting helpers for these kind of questions next time!
want to start a(n) (advanced) discussion? scripters for you |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 30 Aug 2013 06:36 PM |
I prefer a different method:
dir = ((CFrame.new(Vector3.new(0,0,0),dir)*CFrame.Angles(0,0,math.random()*2*pi))*CFrame.Angles(0,(math.random()-0.5)*2*bink,0)).lookVector
It should allow you to get a more consistent error than Oysi's method.
-God Bless-
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 30 Aug 2013 06:57 PM |
Mine is just part of the argument itself... So lel |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
| |
|