im trying to animate the bullets of my tower but it keeps popping up with
even tho i copied the scripts 1:1 and even kill the zombie after animatuions any fixes? here are the scripts
Heres where i call the animate
function tower.Attack(newTower, player)
local config = newTower.Config
local target = tower.FindTarget(newTower, config.Range.Value, config.TargetMode.Value)
if target and target:FindFirstChild("Humanoid") and target.Humanoid.Health > 0 then
local targetCFrame = CFrame.lookAt(newTower.HumanoidRootPart.Position, target.HumanoidRootPart.Position)
newTower.HumanoidRootPart.BodyGyro.CFrame = targetCFrame
animateTowerEvent:FireAllClients(newTower, "Attack", target) -- ANIMATION THINGY THAT IDK HOW TO FIX
target.Humanoid:TakeDamage(config.Damage.Value)
if target.Humanoid.Health <= 0 then
player.Gold.Value += target.Humanoid.MaxHealth
player.Kills.Value += 1
end
task.wait(config.Cooldown.Value)
end
task.wait(0.1)
if newTower and newTower.Parent then
tower.Attack(newTower, player)
end
end
heres the animate script
local function fireProjectile(tower, target)
local projectile = Instance.new("Part")
projectile.Size = Vector3.new(1,1,1)
projectile.CFrame = tower.Head.CFrame
projectile.Anchored = true
projectile.CanCollide = false
projectile.Transparency = 1
projectile.Parent = workspace.Camera
local fire = Instance.new("Fire")
fire.Size = 2
fire.Heat = 0.1
fire.Color = tower.Config.Trail.Value
fire.Parent = projectile
-- UNDER THIS IS WHERE IT BREAKS
local projectileTween = TweenService:Create(projectile, TweenInfo.new(0.5), {Position = target.HumanoidRootPart.Position})
projectileTween:Play()
Debris:AddItem(projectile, 0.5)
end
if you know how to fix PLEASE HELP