This tween isn’t playing and I have no idea why.
function Attack(target)
script.Parent.Parent.Humanoid.Animator:LoadAnimation(script.Parent.Parent.Attack):Play()
coroutine.resume(coroutine.create(function()
for i = 1,20 do
print('w???')
local fly = game.Lighting.Assets.Fire:Clone()
fly.Parent = game.Workspace
wait()
fly:SetPrimaryPartCFrame(script.Parent.Parent.HumanoidRootPart.CFrame - Vector3.new(math.random(-10,30),0,20))
fly.AnimationController.Animator:LoadAnimation(fly.Fire):Play()
wait(1)
fly.PrimaryPart.Anchored = false
local TorielRaycast = Ray.new(fly.PrimaryPart.Position,fly.PrimaryPart.CFrame.LookVector * 100)
local Hit,Position = game.Workspace:FindPartOnRayWithIgnoreList(TorielRaycast,script.Parent.Parent:GetChildren())
print(Position)
print(Hit)
game.TweenService:Create(fly.PrimaryPart,TweenInfo.new(3),{Position = Position}):Play()
wait(3)
game.Debris:AddItem(fly,9)
for i = 1,math.huge do
game.TweenService:Create(fly.PrimaryPart,TweenInfo.new(4),{CFrame = CFrame.new(script.Parent.Parent.Parent.FirePart.Position)}):Play()
wait(4)
game.TweenService:Create(fly.PrimaryPart,TweenInfo.new(4),{CFrame = CFrame.new(script.Parent.Parent.Parent.FirePart2.Position)}):Play()
wait(4)
end
local debounce = false
fly.HumanoidRootPart.Touched:Connect(function(h)
local hum = h.Parent:FindFirstChild("Humanoid")
if hum and h.Parent:FindFirstChild("_enemytag") == nil and debounce == false then
h.Parent.Humanoid:TakeDamage(2)
fly:Destroy()
end
end)
end
wait(0.5)
end))
end
return Attack