-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fling.lua
91 lines (77 loc) · 2.91 KB
/
Fling.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
local core
if typeof(gethui) == 'function' then
core = gethui()
end
if typeof(core) ~= 'Instance' then
core = game:GetService("CoreGui")
end
local flingGui = select(2, pcall(function()
return game:GetObjects("rbxassetid://10171585012")[1]:Clone()
end))
if typeof(flingGui) == 'Instance' and flingGui:IsA("ScreenGui") then
flingGui.Parent = core
local players = game:GetService("Players")
local run = game:GetService("RunService")
local localplayer = players.LocalPlayer
local power = 15e3
local fling_active = {}
local frame = flingGui:WaitForChild("Frame")
local listedFrame = frame:WaitForChild("Frame")
local closeButton = frame:WaitForChild("CloseButton")
local flingButton = listedFrame:WaitForChild("Fling")
closeButton.MouseButton1Up:Connect(function()
return flingGui:Destroy()
end)
flingButton.MouseButton1Up:Connect(function()
local character = localplayer.Character
if typeof(fling_active[character]) == 'Instance' then
return
end
local head = character:FindFirstChild("Head")
local torso = character:FindFirstChild("Torso")
local lleg = character:FindFirstChild("Left Leg")
local rleg = character:FindFirstChild("Right Leg")
local uppertorso = character:FindFirstChild("UpperTorso")
local lowertorso = character:FindFirstChild("LowerTorso")
local rootpart = character:FindFirstChild("HumanoidRootPart")
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
local content = {head, torso, lleg, rleg, uppertorso, lowertorso}
local connections = {}
if typeof(getconnections) == 'function' then
for _, part in pairs(content) do
for _, connection in pairs(getconnections(part:GetPropertyChangedSignal("CanCollide"))) do
pcall(connection.Disable, connection)
end
for _, connection in pairs(getconnections(part.Changed)) do
pcall(connection.Disable, connection)
end
end
connections = {
table.unpack(getconnections(game.DescendantAdded)),
table.unpack(getconnections(workspace.DescendantAdded)),
table.unpack(getconnections(character.DescendantAdded)),
typeof(rootpart) == 'Instance' and table.unpack(getconnections(rootpart.ChildAdded)),
typeof(humanoid) == 'Instance' and table.unpack(getconnections(humanoid:GetPropertyChangedSignal("WalkSpeed"))),
typeof(humanoid) == 'Instance' and table.unpack(getconnections(humanoid.Changed))
}
end
for _, connection in pairs(connections) do
pcall(connection.Disable, connection)
end
local connection; connection = run.Stepped:Connect(function()
for _, part in pairs(content) do
part.CanCollide = false
end
humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
end)
task.wait(0.1)
local thrust = Instance.new("BodyThrust")
thrust.Force = Vector3.new(power, 0, power)
thrust.Location = rootpart.Position
thrust.Parent = rootpart
humanoid.WalkSpeed = 50
for _, connection in pairs(connections) do
pcall(connection.Enable, connection)
end
end)
end