Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a gun bullet ignore parts? Like walls and objects.

Asked by 7 years ago

Hey guys I have a problem. I have a script that shoots players that aren't me and It works perfectly. But the problem is that the bullet shoots through walls and objects. Any idea why and how to make it not do it?

Here's the script:

01local Rel = 0
02local MaxDis = 100
03local Mode = "Normal"
04 
05local Lazor = Instance.new("Part")
06Lazor.BrickColor = BrickColor.new("really red")
07Lazor.Anchored = true
08Lazor.BottomSurface = "Smooth"
09Lazor.TopSurface = "Smooth"
10Lazor.CanCollide = false
11Lazor.Transparency = 0.3
12Lazor.Reflectance = 0.2
13local Mesh = Instance.new("CylinderMesh")
14Mesh.Scale = Vector3.new(0.2,1,0.2)
15Mesh.Parent = Lazor
View all 95 lines...
0
Try setting the CanCollide property of Lazor to true. RayCurse 1518 — 7y
0
Laser.CFrame = script.Parent.CFrame + script.Parent.CFrame.lookVector * Distance/2 You do not check for any parts that are in the way. User#5423 17 — 7y
0
Use RayCasting instead of Part bullets Validark 1580 — 7y
0
Any Idea how? wilsonsilva007 373 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Not Tired, But :

1Lazor.CanCollide = true
Ad

Answer this question