Why isn't my second For i,v loop getting fired after the first one?
So i made a script that makes a BodyVelocity in someone's UpperTorso, then the for i,v speed of the Velocity decreases it. Afterwards, the second for i,v loop starts and makes a part that has the position of the player with the BodyVelocity, but for some reason it doesn't get fired.
02 | replicatedstorage = game:GetService( "ReplicatedStorage" ) |
03 | RicoClass = replicatedstorage.RicoClass |
04 | Ult = RicoClass:FindFirstChild( "Ultimate" ) |
06 | tool = script.Parent.Parent.Parent |
09 | Ult.OnServerEvent:connect( function (player) |
10 | local players = game.Workspace:GetChildren() |
11 | local root = player.Character.HumanoidRootPart |
12 | local bv = Instance.new( "BodyVelocity" ) |
14 | for i,v in pairs (players) do |
15 | local here = v:findFirstChild( "Humanoid" ) |
16 | if v:findFirstChild( "Humanoid" ) and here ~ = player.Character:FindFirstChild( "Humanoid" ) then |
17 | if (root.Position - v.UpperTorso.Position).magnitude < = 35 then |
19 | bv.Parent = v.HumanoidRootPart |
20 | bv.MaxForce = Vector 3. new( 1 e 8 , 1 e 8 , 1 e 8 ) |
21 | bv.Velocity = v.HumanoidRootPart.CFrame.upVector * 23 |
25 | bv.Velocity = v.HumanoidRootPart.CFrame.upVector + Vector 3. new( 0 ,i, 0 ) |
27 | local l = RicoClass.WaveP:clone() |
28 | l.Parent = game:GetService( "Workspace" ).Attacks [ "Rico's Attacks" ] |
30 | l.CFrame = CFrame.new(v.UpperTorso.Position) |
35 | l.Size = l.Size + Vector 3. new(b,b,b) |