Call a function in a script without stopping script?
Okay so in this script, I need it to call a function but then continue on with the script without waiting for the function to finish. What can I do?
its calling the fixPlayer function and I need it to not wait for that function to finish to continue killing other players/blowing them up
01 | sp = script.Parent.Parent:WaitForChild( "HitBox" ) |
07 | for i, v in pairs (game.Players:GetChildren()) do |
08 | if v:FindFirstChild(v.Name.. "Dead" ) then |
09 | v:WaitForChild(v.Name.. "Dead" ):Destroy() |
10 | local t = v.Character:WaitForChild( "Torso" ) |
11 | local h = v.Character:WaitForChild( "Humanoid" ) |
14 | t.CFrame = t.CFrame + Vector 3. new( 0 , 7.5 , 0 ) |
17 | t.CFrame = script.Parent.Parent.Parent.Parent.SecondPosition.CFrame |
18 | local spawns = script.Parent.Parent.Parent.Parent.Spawns:GetChildren() |
19 | v.Character:MoveTo(spawns [ math.random( 1 , 4 ) ] .Position) |
21 | game.Players [ t.Parent.Name ] .PlayerValues.ObjectPickedUp.Value = false |
28 | if script.Parent ~ = nil then |
29 | for _, v in pairs (game.Players:GetChildren()) do |
31 | local h = v.Character:FindFirstChild( "Humanoid" ) |
32 | local t = v.Character:FindFirstChild( "Torso" ) |
33 | if t and h and h.Health> 0 then |
34 | local relative = sp.CFrame:toObjectSpace(t.CFrame).p |
35 | if relative.x<sp.Size.x*numX and relative.x>-sp.Size.x*numX and relative.y<sp.Size.y*numY and relative.y>-sp.Size.y*numY and relative.z<sp.Size.z*numZ and relative.z>-sp.Size.z*numZ and script.Parent ~ = nil then |
36 | if script.Parent.Exploder.Value = = true then |
37 | script.Disabled = true |
39 | script.PlayerScream:Play() |
41 | local tag = script.KillTag:Clone() |
42 | tag.Parent = game.Players [ t.Parent.Name ] |
43 | tag.Name = "" ..t.Parent.Name.. "Dead" |
51 | until script.Disabled = = true or script.Parent = = nil |