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
 

Gun script help

Previous Thread :: Next Thread 
PH4NT0MH1V3 is not online. PH4NT0MH1V3
Joined: 17 Sep 2010
Total Posts: 5611
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 is not online. xebo
Joined: 21 Apr 2015
Total Posts: 714
27 Apr 2015 11:03 AM
set them to ignore.
Report Abuse
PH4NT0MH1V3 is not online. PH4NT0MH1V3
Joined: 17 Sep 2010
Total Posts: 5611
27 Apr 2015 11:04 AM
that doesn't help, but ok


ACCEPT MY LOVE ☆
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
27 Apr 2015 11:54 AM
What is sp? earlier in the script do you ever find sp = "thing"?
Report Abuse
PH4NT0MH1V3 is not online. PH4NT0MH1V3
Joined: 17 Sep 2010
Total Posts: 5611
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
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
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
PH4NT0MH1V3 is not online. PH4NT0MH1V3
Joined: 17 Sep 2010
Total Posts: 5611
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
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
27 Apr 2015 12:15 PM
change

sp

to

sp.Parent

That might work.
Report Abuse
PH4NT0MH1V3 is not online. PH4NT0MH1V3
Joined: 17 Sep 2010
Total Posts: 5611
27 Apr 2015 12:16 PM
Cheers, I'll try it.


ACCEPT MY LOVE ☆
Report Abuse
PH4NT0MH1V3 is not online. PH4NT0MH1V3
Joined: 17 Sep 2010
Total Posts: 5611
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
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
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
PH4NT0MH1V3 is not online. PH4NT0MH1V3
Joined: 17 Sep 2010
Total Posts: 5611
27 Apr 2015 12:26 PM
Damn.


ACCEPT MY LOVE ☆
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