For some reason, the touched event isn't working. I don't know why! Help!
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local tool = script.Parent
local Handle = tool:WaitForChild("Handle")
local debounce = true
local m = player:GetMouse()
local speed = 150
tool.Activated:connect(function()
if debounce == true then
debounce = false
local sound = tool.Sound
sound:Play()
wait(.3)
sound:Stop()
local pos = tool.Handle;
local endPos = m.Hit.p;
local ball = Instance.new("Part", workspace)
ball.Name = "Ball_" .. player.Name;
ball.CanCollide = false;
ball.Shape = "Ball";
ball.Size = Vector3.new(1, 1, 1);
local ray = Ray.new(pos.CFrame.p, (endPos - pos.CFrame.p).unit * 300);
local hit, position = workspace:FindPartOnRay(ray, player.Character);
local distance = (position - pos.CFrame.p).magnitude;
ball.CFrame = CFrame.new(position, pos.CFrame .p) * CFrame.new(0, 0, 1.5) * CFrame.new(0, 0, -distance);
game.Debris:AddItem(ball, 1);
local sT = 0;
local bv = Instance.new("BodyVelocity", ball);
bv.velocity = -ball.CFrame.lookVector * speed;
wait(.4)
debounce = true
ball.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)

3 comments
does everything else work? Try to remove the if statement and see if it works, if it does then you know where the problem is located, then you can just work around that. I can't see atm why it isn't working, maybe because I am pretty tired.
Now it says this...
13:59:41.042 - Torso is not a valid member of Workspace