fxmod.CreateSound(HRP,"rbxassetid://1880899296",5,10000,0)
for i = 0,14 do
local NewHands = rs.Hand:Clone()
local Position = Param1*CFrame.new(Vector3.new(0,-10,-(3*i)),NewHands.Position + Param1.LookVector)*CFrame.Angles(0,math.rad(180),math.rad(180))
NewHands.CFrame = Position
NewHands.Parent = workspace
local DamageTable = {}
debris:AddItem(NewHands,2.5)
task.spawn(function()
local tween = ts:Create(NewHands,TweenInfo.new(0.75,Enum.EasingStyle.Quart,Enum.EasingDirection.InOut,0,false,i/20 --[[using this was my solution to this problem, however it still lags momentarily.]]),{CFrame = NewHands.CFrame + Vector3.new(0,11,0)})
tween:Play()
tween.Completed:Wait()
task.wait(0.3)
local tween2 = ts:Create(NewHands,TweenInfo.new(1,Enum.EasingStyle.Quart),{CFrame = NewHands.CFrame - Vector3.new(0,11,0), Transparency = 1})
tween2:Play()
end)
task.spawn(function()
task.wait(2.5)
c:Disconnect()
end)
task.wait(0.05)
end
Something like this? I don’t have the info to replicate it and test it myself, but using a dummy part it behaved as intended.
fxmod.CreateSound(HRP,"rbxassetid://1880899296",5,10000,0)
--creating a reference for the tweeninfo here saves on math constructing them each loop
local tweenThrow = TweenInfo.new(0.75, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut)
local tweenDrop = TweenInfo.new(1, Enum.EasingStyle.Quart)
for i = 0,14 do
local completed--declare the event connection before assigning so that it can be referenced inside of the event itself
local NewHands = rs.Hand:Clone()
NewHands.CFrame = Param1*CFrame.new(Vector3.new(0,-10,-(3*i)),NewHands.Position + Param1.LookVector)*CFrame.Angles(0,math.rad(180),math.rad(180))
NewHands.Parent = workspace
local throw = ts:Create(NewHands, tweenThrow, {CFrame = NewHands.CFrame + Vector3.new(0,11,0)})
--listen for the first tween to finish and play the second
completed = throw.Completed:Connect(function()
--don't need variable reference for this tween, so we can call play on the constructor itself
ts:Create(NewHands, tweenDrop, {CFrame = NewHands.CFrame - Vector3.new(0,11,0), Transparency = 1}):Play()
task.wait(0.75)--waiting in here won't yield outside of this function
NewHands:Destroy()--destroy hand instead of debris service
completed:Disconnect()--disconnect event (free memory)
end)
--call the play after having declared the event listening for its completion
throw:Play()
task.wait(0.05)
end
I’m not sure what c or DamageTable were doing so I omitted them from the code.