local function OnTouched(shot, otherPart)
local character, humanoid = FindCharacterAncestor(otherPart)
if character and humanoid and character ~= Character then
ApplyTags(humanoid)
if shot then
local hitFadeSound = shot:FindFirstChild(HitFadeSound.Name)
if hitFadeSound then
hitFadeSound.Parent = humanoid.Torso
hitFadeSound:Play()
end
shot:Destroy()
end
Dematerialize(character, humanoid, otherPart)
elseif otherPart.ClassName == "Part" then
shot:Destroy()
end
end
I have a laser and I want it to destory() the bullet if it touches a part, cause right now it goes through the part. Any help with this? It isn't showing any output, so don't know what the error is. Inside a LocalScript.

7 comments
that still dosent work :/ I just have a LocalScript inside a Tool.
OH, that's the problem. The function fires when the tool is touched. Just change the "script.Parent" part to the object you want to be touched (i.e. game.Workspace.laser)
-Edit- I change it to the whole script, I am just using ROBLOX's HyperLaser, I think it should be around the bottom where it should be to destory if it doesnt hit a player but a part. Can you just have a quick look?
Oh jeez, that's a lot of code. I most likely won't be able to detect a problem here.
maybe around 149 163 abouts
I am pretty sure it has to be placed 143 -163 cause thats where it kills the player. I just dont know how to detect if the bullet hit a part instead of a player. Please just ook at that 20 lines of code
I editte dagain with just the piece of code I need. I added an attemp on lines 14-15 but that just destroys the bullet the second is eaves the barrel