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

How to make bullet stop at what the raycast hit?

Asked by 3 years ago

So i'm trying to make a script that shoots a bullet whenever the gun fires, but I dont know how to make it so that the bullet stops at the hit target

01local tool = script.Parent
02local Handle = tool:WaitForChild("Handle")
03local Shoot = tool:WaitForChild("Shoot")
04 
05local Debris = game:GetService("Debris")
06 
07local range = 100
08 
09local damage = 20
10local headshotDamage = 40
11 
12Shoot.OnServerEvent:Connect(function(Player, mousePos, originPos)
13    local Character = Player.Character
14    local Humanoid = Character:WaitForChild("Humanoid")
15 
View all 55 lines...

Answer this question