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

Call a function in a script without stopping script?

Asked by 9 years ago

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

01sp=script.Parent.Parent:WaitForChild("HitBox")
02local numX = 1
03local numY = 1
04local numZ = 1
05 
06function fixPlayer()
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")
12            for Jump=25,1,-1 do
13                wait()
14                t.CFrame = t.CFrame + Vector3.new(0,7.5,0)
15            end
View all 51 lines...

1 answer

Log in to vote
0
Answered by 9 years ago

To my knowledge, the script always reads through the code; but it's near instantaneous anyway, so you should be able to run a standard function and the effects would still be the same.

0
found that you can do spawn(function() --Wrtie stuffs end) and it works that way CarterTheHippo 120 — 9y
Ad

Answer this question