R

fling plr

public
rrixh Mar 14, 2024 Never 93
Clone
Plaintext flingplr 221 lines (186 loc) | 6.97 KB
1
local player = game.Players.LocalPlayer
2
local mouse = player:GetMouse()
3
local Targets = {plr}
4
5
local Players = game:GetService("Players")
6
local Player = Players.LocalPlayer
7
8
local AllBool = false
9
10
local GetPlayer = function(Name)
11
Name = Name:lower()
12
if Name == "all" or Name == "others" then
13
AllBool = true
14
return
15
elseif Name == "random" then
16
local GetPlayers = Players:GetPlayers()
17
if table.find(GetPlayers,Player) then table.remove(GetPlayers,table.find(GetPlayers,Player)) end
18
return GetPlayers[math.random(#GetPlayers)]
19
elseif Name ~= "random" and Name ~= "all" and Name ~= "others" then
20
for _,x in next, Players:GetPlayers() do
21
if x ~= Player then
22
if x.Name:lower():match("^"..Name) then
23
return x;
24
elseif x.DisplayName:lower():match("^"..Name) then
25
return x;
26
end
27
end
28
end
29
else
30
return
31
end
32
end
33
34
local Message = function(_Title, _Text, Time)
35
print(_Title)
36
print(_Text)
37
print(Time)
38
end
39
40
local SkidFling = function(TargetPlayer)
41
local Character = Player.Character
42
local Humanoid = Character and Character:FindFirstChildOfClass("Humanoid")
43
local RootPart = Humanoid and Humanoid.RootPart
44
45
local TCharacter = TargetPlayer.Character
46
local THumanoid
47
local TRootPart
48
local THead
49
local Accessory
50
local Handle
51
52
if TCharacter:FindFirstChildOfClass("Humanoid") then
53
THumanoid = TCharacter:FindFirstChildOfClass("Humanoid")
54
end
55
if THumanoid and THumanoid.RootPart then
56
TRootPart = THumanoid.RootPart
57
end
58
if TCharacter:FindFirstChild("Head") then
59
THead = TCharacter.Head
60
end
61
if TCharacter:FindFirstChildOfClass("Accessory") then
62
Accessory = TCharacter:FindFirstChildOfClass("Accessory")
63
end
64
if Accessoy and Accessory:FindFirstChild("Handle") then
65
Handle = Accessory.Handle
66
end
67
68
if Character and Humanoid and RootPart then
69
if RootPart.Velocity.Magnitude < 50 then
70
getgenv().OldPos = RootPart.CFrame
71
end
72
if THumanoid and THumanoid.Sit and not AllBool then
73
end
74
if THead then
75
workspace.CurrentCamera.CameraSubject = THead
76
elseif not THead and Handle then
77
workspace.CurrentCamera.CameraSubject = Handle
78
elseif THumanoid and TRootPart then
79
workspace.CurrentCamera.CameraSubject = THumanoid
80
end
81
if not TCharacter:FindFirstChildWhichIsA("BasePart") then
82
return
83
end
84
85
local FPos = function(BasePart, Pos, Ang)
86
RootPart.CFrame = CFrame.new(BasePart.Position) * Pos * Ang
87
Character:SetPrimaryPartCFrame(CFrame.new(BasePart.Position) * Pos * Ang)
88
RootPart.Velocity = Vector3.new(9e7, 9e7 * 10, 9e7)
89
RootPart.RotVelocity = Vector3.new(9e8, 9e8, 9e8)
90
end
91
92
local SFBasePart = function(BasePart)
93
local TimeToWait = 2
94
local Time = tick()
95
local Angle = 0
96
97
repeat
98
if RootPart and THumanoid then
99
if BasePart.Velocity.Magnitude < 50 then
100
Angle = Angle + 100
101
102
FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle),0 ,0))
103
task.wait()
104
105
FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
106
task.wait()
107
108
FPos(BasePart, CFrame.new(2.25, 1.5, -2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
109
task.wait()
110
111
FPos(BasePart, CFrame.new(-2.25, -1.5, 2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
112
task.wait()
113
114
FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
115
task.wait()
116
117
FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
118
task.wait()
119
else
120
FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
121
task.wait()
122
123
FPos(BasePart, CFrame.new(0, -1.5, -THumanoid.WalkSpeed), CFrame.Angles(0, 0, 0))
124
task.wait()
125
126
FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
127
task.wait()
128
129
FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
130
task.wait()
131
132
FPos(BasePart, CFrame.new(0, -1.5, -TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(0, 0, 0))
133
task.wait()
134
135
FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
136
task.wait()
137
138
FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(math.rad(90), 0, 0))
139
task.wait()
140
141
FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
142
task.wait()
143
144
FPos(BasePart, CFrame.new(0, -1.5 ,0), CFrame.Angles(math.rad(-90), 0, 0))
145
task.wait()
146
147
FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
148
task.wait()
149
end
150
else
151
break
152
end
153
until BasePart.Velocity.Magnitude > 500 or BasePart.Parent ~= TargetPlayer.Character or TargetPlayer.Parent ~= Players or not TargetPlayer.Character == TCharacter or THumanoid.Sit or Humanoid.Health <= 0 or tick() > Time + TimeToWait
154
end
155
156
workspace.FallenPartsDestroyHeight = 0/0
157
158
local BV = Instance.new("BodyVelocity")
159
BV.Name = "EpixVel"
160
BV.Parent = RootPart
161
BV.Velocity = Vector3.new(9e8, 9e8, 9e8)
162
BV.MaxForce = Vector3.new(1/0, 1/0, 1/0)
163
164
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
165
166
if TRootPart and THead then
167
if (TRootPart.CFrame.p - THead.CFrame.p).Magnitude > 5 then
168
SFBasePart(THead)
169
else
170
SFBasePart(TRootPart)
171
end
172
elseif TRootPart and not THead then
173
SFBasePart(TRootPart)
174
elseif not TRootPart and THead then
175
SFBasePart(THead)
176
elseif not TRootPart and not THead and Accessory and Handle then
177
SFBasePart(Handle)
178
else
179
end
180
181
BV:Destroy()
182
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true)
183
workspace.CurrentCamera.CameraSubject = Humanoid
184
185
repeat
186
RootPart.CFrame = getgenv().OldPos * CFrame.new(0, .5, 0)
187
Character:SetPrimaryPartCFrame(getgenv().OldPos * CFrame.new(0, .5, 0))
188
Humanoid:ChangeState("GettingUp")
189
table.foreach(Character:GetChildren(), function(_, x)
190
if x:IsA("BasePart") then
191
x.Velocity, x.RotVelocity = Vector3.new(), Vector3.new()
192
end
193
end)
194
task.wait()
195
until (RootPart.Position - getgenv().OldPos.p).Magnitude < 25
196
workspace.FallenPartsDestroyHeight = getgenv().FPDH
197
else
198
end
199
end
200
201
getgenv().Welcome = true
202
if Targets[1] then for _,x in next, Targets do GetPlayer(x) end else return end
203
204
if AllBool then
205
for _,x in next, Players:GetPlayers() do
206
SkidFling(x)
207
end
208
end
209
210
for _,x in next, Targets do
211
if GetPlayer(x) and GetPlayer(x) ~= Player then
212
if GetPlayer(x).UserId ~= 1414978355 then
213
local TPlayer = GetPlayer(x)
214
if TPlayer then
215
SkidFling(TPlayer)
216
end
217
else
218
end
219
elseif not GetPlayer(x) and not AllBool then
220
end
221
end