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

Calling a function if a player is Magnitude of a block?

Asked by 9 years ago

Is there anyway rather than having a loop that detects if a player's torso is Magnitude x of a block, all I know is how to do the loop:

while true do
    for i, v in pairs (game.Players:GetChildren()) do
        if (v.Character.Torso.Position - script.Parent.Position).magnitude <= 10 then
    end
end
wait()
end

Answer this question