So, my ability script works, and detects if a certain tower is attacking so it can activate the ability. Problem is, it doesnt use the ability when the tower can one shot. I have no idea how to fix this because it works when the tower doesnt one shot. The tower for some reason, doesnt sense when the humanoid dies.
if config:FindFirstChild("OriginalTower").Value == "Mercenary" then
local humanoid = target:FindFirstChild("Humanoid")
if humanoid and humanoid:IsA("Humanoid") then
humanoid.Died:Connect(function()
player.leaderstats.Money.Value += newTower.Config.MoneyPerKill.Value
if newTower.Head then
newTower.Head.MoneyGain.TextLabel.Visible = true
newTower.Head.MoneyGain.TextLabel.Text = "$"..newTower.Config.MoneyPerKill.Value
newTower.Head.MoneyGain.TextLabel.TextTransparency = 0
newTower.Head.Cash:Play()
for i = 1,10 do
if newTower.Head then
newTower.Head.MoneyGain.TextLabel.TextTransparency += 0.1
newTower.Head.MoneyGain.ExtentsOffset += Vector3.new(0, 0.1, 0)
wait(0.1)
end
end
newTower:FindFirstChild("Head"):FindFirstChild("MoneyGain").TextLabel.Visible = false
end
end)
end
end