For some reason, the touched event part doesn't seem to be working. Please Help!
tool.Activated:connect(function()
if debounce == true then
debounce = false
local firesound = tool.Sound
firesound:Play()
wait(.3)
firesound:Stop()
local pos = tool.Handle;
local endPos = m.Hit.p;
local shot = Instance.new("Part", workspace)
shot.Name = "Shot_" .. player.Name;
shot.CanCollide = false;
shot.Shape = "Ball";
shot.Size = Vector3.new(1, 1, 1);
local ray = Ray.new(pos.CFrame.p, (endPos - pos.CFrame.p).unit * 300); -- CHANGE 300 HERE TO A SMALLER NUM IF YOU WANT A SHORTER RAY
local hit, position = workspace:FindPartOnRay(ray, player.Character);
local distance = (position - pos.CFrame.p).magnitude;
shot.CFrame = CFrame.new(position, pos.CFrame .p) * CFrame.new(0, 0, 1.5) * CFrame.new(0, 0, -distance);
game.Debris:AddItem(shot, 1);
local sT = 0;
local bv = Instance.new("BodyVelocity", shot);
bv.velocity = -shot.CFrame.lookVector * speed;
wait(.4)
debounce = true
shot.Touched:connect(function(hit)
if hit.Parent.Torso:FindFirstChild("Fire") then
local fire = hit.Parent.Torso.Fire
game:GetService("Debris"):AddItem(fire, .01)
end
end)
end
end)

2 comments
Is there an object called Fire as a descendant of hit.Parent.Torso?
yes.