1 | local Players = game:GetService("Players") |
2 | |
3 | local Player = Players.LocalPlayer |
4 | local Character, Humanoid, RootPart |
5 | |
6 | local Camera = workspace.CurrentCamera |
7 | |
8 | local IsVoiding = false |
9 | |
10 | local GetNearestPlayers = function() |
11 | if RootPart then |
12 | for _, x in next, Players:GetPlayers() do |
13 | if x ~= Player then |
14 | local x_Character = x.Character |
15 | local x_Humanoid = x_Character and x_Character:FindFirstChildWhichIsA("Humanoid") |
16 | local x_RootPart = x_Humanoid and x_Humanoid.RootPart |
17 | |
18 | if x_RootPart and (RootPart.Position - x_RootPart.Position).Magnitude < 2 then |
19 | for _, x in next, x_Humanoid:GetPlayingAnimationTracks() do |
20 | if x.Animation and x.Animation.AnimationId:match("148840371") or x.Animation.AnimationId:match("5918726674") then |
21 | return true |
22 | end |
23 | end |
24 | |
25 | return false |
26 | end |
27 | end |
28 | end |
29 | end |
30 | |
31 | return false |
32 | end |
33 | |
34 | workspace.FallenPartsDestroyHeight = 0 / 0 |
35 | |
36 | while true do |
37 | Character = Player.Character |
38 | Humanoid = Character and Character:FindFirstChildWhichIsA("Humanoid") |
39 | RootPart = Humanoid and Humanoid.RootPart |
40 | |
41 | if GetNearestPlayers() and Humanoid and RootPart and not IsVoiding then |
42 | IsVoiding = true |
43 | |
44 | local CurrentPosition = RootPart.Velocity.Magnitude < 50 and RootPart.CFrame or Camera.Focus |
45 | local Timer = tick() |
46 | |
47 | repeat |
48 | RootPart.CFrame = CFrame.new(0, -499, 0) * CFrame.Angles(math.rad(90), 0, 0) |
49 | RootPart.AssemblyLinearVelocity = Vector3.new() |
50 | task.wait() |
51 | until tick() > Timer + 1 |
52 | |
53 | RootPart.AssemblyLinearVelocity = Vector3.new() |
54 | RootPart.CFrame = CurrentPosition |
55 | |
56 | Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp) |
57 | |
58 | IsVoiding = false |
59 | end |
60 | |
61 | task.wait() |
62 | end |