|
| 27 Apr 2015 11:00 AM |
Recently my friend scripted me a gun, but it wasn't shooting behind me for some reason, and someone told me I need to set FindPartOnRay to ignore (you can see where this is going)
problem is, I can't script. at all.
The two lines I need to change are: local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*(totaldist-currentdist)),sp)
hit,pos=game.Workspace:FindPartOnRay(Ray.new(Laser.Position,vec*(maxdist)),sp)
What would I change in them to have FindPartOnRay set to ignore?
Cheers.
ACCEPT MY LOVE ☆ |
|
|
| Report Abuse |
|
|
xebo
|
  |
| Joined: 21 Apr 2015 |
| Total Posts: 714 |
|
| |
|
|
| 27 Apr 2015 11:04 AM |
that doesn't help, but ok
ACCEPT MY LOVE ☆ |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 11:54 AM |
| What is sp? earlier in the script do you ever find sp = "thing"? |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 11:55 AM |
I posted the whole line, don't think anything related to it comes afterwards.
ACCEPT MY LOVE ☆ |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 11:57 AM |
| sp = something should be before hand. sp is what the ray is currently ignoring, You probably have to put the players character instead of sp. But i need to know what sp is because the tool may be outside of the player. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 12:00 PM |
I'll show you the lines again
local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*(totaldist-currentdist)),sp)
hit,pos=game.Workspace:FindPartOnRay(Ray.new(Laser.Position,vec*(maxdist)),sp)
would I turn sp to "humanoid" or?
ACCEPT MY LOVE ☆ |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 12:15 PM |
change
sp
to
sp.Parent
That might work. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 12:16 PM |
Cheers, I'll try it.
ACCEPT MY LOVE ☆ |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 12:18 PM |
Nope, now it does the thing all the time instead of only doing it when pointing at myself.
ACCEPT MY LOVE ☆ |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 12:24 PM |
| Did you try changing every sp to that? If so, then most likely the gun is placed outside of the player. What does this mean for you? Basically it isn't going to work unless most of the script is changed. |
|
|
| Report Abuse |
|
|
| |
|