so, I have a tower that I want to have AOE damage. I have NO idea how to do this. this is my attack script function. What would I have to add to implement this?
function tower.Attack(newTower, player)
local config = newTower.Config
local target = tower.FindTarget(newTower, config.Range.Value, config.TargetMode.Value)
if target ~= nil and target:FindFirstChild("Humanoid") then
AnimateEvent:FireAllClients(newTower, "Attack", target)
if target then
local targetCFrame = CFrame.lookAt(newTower.HumanoidRootPart.Position, target.HumanoidRootPart.Position)
newTower.HumanoidRootPart.BodyGyro.CFrame = targetCFrame
end
damage(target, config)
task.wait(config.Cooldown.Value)
end
task.wait(0.05)
if newTower and newTower.Parent then
tower.Attack(newTower, player)
end
end