So I copied a fireball that @Alvin_Blox made, but it’s not doing damage on the npcs. Everything works great, the fireball launches but apparentlly, it does no damage:
local fireball = game:GetService('ServerStorage'):FindFirstChild('Fireball')
local event = game:GetService('ReplicatedStorage'):FindFirstChild('FireEvent')
event.OnServerEvent:Connect(function(player)
local character = player.Character
local fb2 = fireball:Clone()
fb2.CFrame = character:FindFirstChild('HumanoidRootPart').CFrame
local bodyVelocity = Instance.new('BodyVelocity')
bodyVelocity.MaxForce = Vector3.new(5000, 5000, 5000)
bodyVelocity.Velocity = (character:FindFirstChild('HumanoidRootPart').CFrame.lookVector*250)
bodyVelocity.Parent = fb2
fb2.Parent = workspace
local touchConn
touchConn = fb2.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
if not hit.Parent.Name == player.Name then
hit.Parent:BreakJoints()
if touchConn ~= nil then
touchConn:Disconnect()
end
end
end
end)
wait(2)
if touchConn ~= nil then
touchConn:Disconnect()
end
fb2:Destroy()
end)
Focus primarly (I think) on the touched event, I think thats where the problem lies.
But, I’ve tried it on various npc’s and it don’t work.