I made a script that gets the opponents around another player, and inserts BodyVelocity on them that stops them in the air. Afterwards, the script creates a part on the opponents, but the scripts only fires one at a time. How can i fix this, so that it can fire on the opponents all at once.
baseAtk = 25
replicatedstorage = game:GetService("ReplicatedStorage")
RicoClass = replicatedstorage.RicoClass
Ult = RicoClass:FindFirstChild("Ultimate")
debounce = true
tool = script.Parent.Parent.Parent
Ult.OnServerEvent:connect(function(player)
local players = game.Workspace:GetChildren()
local root = player.Character.HumanoidRootPart
local bv = Instance.new("BodyVelocity")
for i,v in pairs(players)do
local here = v:findFirstChild("Humanoid")
if v:findFirstChild("Humanoid")and here ~= player.Character:FindFirstChild("Humanoid") then
if (root.Position - v.UpperTorso.Position).magnitude <=35 then
bv.Parent = v.HumanoidRootPart
bv.MaxForce = Vector3.new(1e8,1e8,1e8)
bv.Velocity = v.HumanoidRootPart.CFrame.upVector * 23
wait()
for i = 23,-1,-1 do
wait(0.01)
bv.Velocity = v.HumanoidRootPart.CFrame.upVector + Vector3.new(0,i,0)
end
local l = RicoClass.SmallWave:clone()
l.Parent = game:GetService("Workspace").Attacks["Rico's Attacks"]
l.Transparency = 1
l.LightningBolt.Disabled = true
l.CFrame = CFrame.new(v.UpperTorso.Position)
for b = 1,0,-0.2 do
wait(0.1)
l.Transparency = b
l.Size = l.Size + Vector3.new(b,b,b)
l.LightningBolt.Disabled = false
end
end
end
end
end)

4 comments
Im not sure how i can make this answer correlate to fix my problem...
I'm trying to get people around the player, not just simply get people in players...
He's not giving you a flat out answer. Use that script and the knowledge of what it does, and using your brain, figure out how to make them work together.
correct.