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.
You simply forgot the Event part of the function. Just put this in.
script.Parent.Touched:connect(onTouched) -- assuming the script is in the part that you want to be touched