Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why isn't my second For i,v loop getting fired after the first one?

Asked by
rexpex 45
7 years ago

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.

01baseAtk = 25
02replicatedstorage = game:GetService("ReplicatedStorage")
03RicoClass = replicatedstorage.RicoClass
04Ult = RicoClass:FindFirstChild("Ultimate")
05debounce = true
06tool = script.Parent.Parent.Parent
07 
08 
09Ult.OnServerEvent:connect(function(player)
10local players = game.Workspace:GetChildren()
11local root = player.Character.HumanoidRootPart
12local bv = Instance.new("BodyVelocity")
13 
14for i,v in pairs(players)do
15local here = v:findFirstChild("Humanoid")
View all 41 lines...

1 answer

Log in to vote
1
Answered by 7 years ago

Hi!

Your second For i,v loop won't do anything because b is valueless. You need to add another comma and put "-1", so the loop knows to go down by 1. It is instead trying to go up by 1, which it can't.

1for b = 1,0,-1 do
2    wait(0.1)
3    l.Transparency = b
4    l.Size = l.Size+Vector3.new(b,b,b)
5end
0
OH I HADN'T REALIZED rexpex 45 — 7y
Ad

Answer this question