-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgistfile1.lua
110 lines (88 loc) · 3.47 KB
/
gistfile1.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
--// Grapher
local Grapher = {}
--// UI Setup
do
local GrapherSection = Variables.CatchingTab:AddSection("Grapher")
GrapherSection:AddToggle("Enabled", {flag = "Grapher_Enabled"}, function() end)
end
Grapher.Marker = Instance.new("Part")
Grapher.Marker.Anchored = true
Grapher.Marker.Transparency = .8
Grapher.Marker.Color = Color3.fromRGB(255, 0, 0)
Grapher.Marker.CanCollide = false
Grapher.Marker.Name = "Marker"
Grapher.Params = RaycastParams.new()
Grapher.Params.IgnoreWater = true
Grapher.Params.FilterType = Enum.RaycastFilterType.Whitelist
Grapher.CastStep = 3 / 60
Grapher.LastSavedPower = 60
function Grapher:GetCollidables()
local Collidables = {}
for _, BasePart in ipairs(workspace:GetDescendants()) do
if BasePart:IsA("BasePart") and BasePart.CanCollide == true then
table.insert(Collidables, BasePart)
end
end
return Collidables
end
function Grapher:WipeMarkers()
for i,v in pairs(workspace:GetChildren()) do
if v.Name == "Marker" then v:Destroy() end
end
end
function Grapher:GetLanding(origin, velocity, c)
local Elapsed = 0
local LastPos = origin
self.Params.FilterDescendantsInstances = self:GetCollidables()
local Football_Highlight;
if c then
Football_Highlight = Instance.new("Highlight", game.CoreGui)
Football_Highlight.Adornee = c
Football_Highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
Football_Highlight.Enabled = true
end
while true do
Elapsed += Grapher.CastStep
local nPos = origin + velocity * Elapsed - Vector3.new(0, .5 * 28 * Elapsed ^ 2, 0)
local Marker = self.Marker:Clone(); Marker.Parent = workspace; Marker.Position = nPos
if c and Football_Highlight and c.Parent ~= workspace or c and not c:FindFirstChildOfClass("BodyForce") then
Football_Highlight:Destroy()
self:WipeMarkers()
break
end
task.wait()
end
end
do
workspace.ChildAdded:Connect(function(child)
if child.Name == "Football" or child.Name == "Handle" and child:IsA("BasePart") and Variables.CatchingTab.Flags["Grapher_Enabled"] then
local tempCon; tempCon = child:GetPropertyChangedSignal("Velocity"):Connect(function()
Grapher:GetLanding(child.Position, child.Velocity, child)
tempCon:Disconnect()
end)
end
end)
--[[
Variables.Client.PlayerGui.ChildAdded:Connect(function(child)
if child.Name == "BallGui" then
task.spawn(function()
while true do if Variables.CatchingTab.Flags["Grapher_Enabled"] then
if child.Parent ~= Variables.Client.PlayerGui then break end
local Frame = child:FindFirstChild("Frame")
local Display = Frame and Frame:FindFirstChild("Disp")
local Power = Display and tonumber(Display.Text)
if Power ~= nil then
Grapher.LastSavedPower = Power
end
Grapher:GetLanding(Variables.Character:FindFirstChild("Head").Position, ((Variables.Client:GetMouse().Hit.Position - Variables.Character:FindFirstChild("Head").Position).Unit * Grapher.LastSavedPower))
task.wait(.2)
Grapher:WipeMarkers()
task.wait()
end
end
end)
end
end)
--]]
end
return Grapher