Run it
Copy the script and paste it into your executor.
ws = :()
rs = :()
Players = :()
uis = :()
hs = :()
CFG = {
mainExtend = ,
deflectExtend = ,
pulseSpeed = , pulseMin = , pulseMax = ,
matchBallHeight = ,
bounceLogic = ,
halfWidth = / ,
halfLength = / ,
mainColor = .(, , ),
deflectColor = .(, , ),
warnColor = .(, , )
}
state = { pulsePhase = }
savedProfiles = {}
makefolder isfolder
()
()
()
savedProfiles = {}
listfiles isfolder ()
files = ()
_, filePath (files)
fileName = filePath:()
fileName
success, content = (readfile, filePath)
success
dataSuccess, data = (() hs:(content) )
dataSuccess data
savedProfiles[fileName] = data
(name, data)
savedProfiles[name] = data
writefile isfolder ()
success, content = (() hs:(data) )
success
(writefile, .. name .. , content)
()
container = ws:()
container container:()
container = .()
container.Name =
container.Parent = ws
(color)
part = .()
part.Material = .Material.Neon
part.Color = color
part.Shape = .PartType.Cylinder
part.Anchored =
part.CanCollide =
part.CastShadow =
part.Parent = container
part
draw3D = {
main = (CFG.mainColor),
deflect = (CFG.deflectColor)
}
()
oldGui = Players.LocalPlayer:():()
oldGui oldGui:()
sg = .()
sg.Name =
sg.ResetOnSpawn =
sg.ZIndexBehavior = .ZIndexBehavior.Sibling
sg.Parent = Players.LocalPlayer:()
frame = .()
frame.Name =
frame.Size = .(, , , )
frame.Position = .(, -, , -)
frame.BackgroundColor3 = .(, , )
frame.BorderSizePixel =
frame.Active =
frame.Draggable =
frame.Parent = sg
stroke = .()
stroke.Thickness =
stroke.Color = .(, , )
stroke.Parent = frame
corner = .()
corner.CornerRadius = .(, )
corner.Parent = frame
tabBar = .()
tabBar.Size = .(, , , )
tabBar.BackgroundColor3 = .(, , )
tabBar.BorderSizePixel =
tabBar.Parent = frame
tbCorner = .()
tbCorner.CornerRadius = .(, )
tbCorner.Parent = tabBar
cover = .()
cover.Size = .(, , , )
cover.Position = .(, , , -)
cover.BackgroundColor3 = .(, , )
cover.BorderSizePixel =
cover.Parent = tabBar
mainPage = .()
mainPage.Size = .(, , , -)
mainPage.Position = .(, , , )
mainPage.BackgroundTransparency =
mainPage.Visible =
mainPage.Parent = frame
configPage = .()
configPage.Size = .(, , , -)
configPage.Position = .(, , , )
configPage.BackgroundTransparency =
configPage.Visible =
configPage.Parent = frame
mainTabBtn = .()
mainTabBtn.Size = .(, , , )
mainTabBtn.BackgroundTransparency =
mainTabBtn.Text =
mainTabBtn.TextColor3 = .(, , )
mainTabBtn.Font = .Font.GothamBold
mainTabBtn.TextSize =
mainTabBtn.Parent = tabBar
configTabBtn = .()
configTabBtn.Size = .(, , , )
configTabBtn.Position = .(, , , )
configTabBtn.BackgroundTransparency =
configTabBtn.Text =
configTabBtn.TextColor3 = .(, , )
configTabBtn.Font = .Font.GothamBold
configTabBtn.TextSize =
configTabBtn.Parent = tabBar
mainTabBtn.MouseButton1Click:(()
mainPage.Visible =
configPage.Visible =
mainTabBtn.TextColor3 = .(, , )
configTabBtn.TextColor3 = .(, , )
)
configTabBtn.MouseButton1Click:(()
mainPage.Visible =
configPage.Visible =
mainTabBtn.TextColor3 = .(, , )
configTabBtn.TextColor3 = .(, , )
)
info = .()
info.Size = .(, , , )
info.Position = .(, -, , )
info.BackgroundTransparency =
info.Text =
info.TextColor3 = .(, , )
info.Font = .Font.Gotham
info.TextSize =
info.TextXAlignment = .TextXAlignment.Right
info.Parent = tabBar
uis.InputBegan:((input, gpe)
gpe input.KeyCode == .KeyCode.RightShift
frame.Visible = frame.Visible
)
mainLenFill, mainLenKnob, mainLenLabel
deflectLenFill, deflectLenKnob, deflectLenLabel
(text, defaultVal, maxVal, posY, callback)
label = .()
label.Size = .(, -, , )
label.Position = .(, , , posY)
label.BackgroundTransparency =
label.Text = text .. .. (.(defaultVal))
label.TextColor3 = .(, , )
label.Font = .Font.GothamSemibold
label.TextSize =
label.TextXAlignment = .TextXAlignment.Left
label.Parent = mainPage
track = .()
track.Size = .(, -, , )
track.Position = .(, , , posY + )
track.BackgroundColor3 = .(, , )
track.BorderSizePixel =
track.Parent = mainPage
fill = .()
fill.Size = .(defaultVal / maxVal, , , )
fill.BackgroundColor3 = .(, , )
fill.BorderSizePixel =
fill.Parent = track
knob = .()
knob.Size = .(, , , )
knob.Position = .(defaultVal / maxVal, -, , -)
knob.BackgroundColor3 = .(, , )
knob.Parent = track
snap =
knob.MouseButton1Down:(() snap = )
uis.InputEnded:((input) input.UserInputType == .UserInputType.MouseButton1 snap = )
rs.RenderStepped:(()
snap
mousePos = uis:().X
trackStart = track.AbsolutePosition.X
trackWidth = track.AbsoluteSize.X
perc = .((mousePos - trackStart) / trackWidth, , )
fill.Size = .(perc, , , )
knob.Position = .(perc, -, , -)
val = .(perc * maxVal)
label.Text = text .. .. (val)
(val)
)
fill, knob, label
(text, defaultRGB, posY, callback)
label = .()
label.Size = .(, , , )
label.Position = .(, , , posY)
label.BackgroundTransparency =
label.Text = text
label.TextColor3 = .(, , )
label.Font = .Font.GothamSemibold
label.TextSize =
label.TextXAlignment = .TextXAlignment.Left
label.Parent = mainPage
box = .()
box.Size = .(, -, , )
box.Position = .(, , , posY)
box.BackgroundColor3 = .(, , )
box.BorderSizePixel =
box.Text = defaultRGB
box.TextColor3 = .(, , )
box.Font = .Font.Code
box.TextSize =
box.Parent = mainPage
bCorner = .()
bCorner.CornerRadius = .(, )
bCorner.Parent = box
box.FocusLost:(()
r, g, b = box.Text:()
r g b
col = .((r), (g), (b))
(col)
)
box
mainLenFill, mainLenKnob, mainLenLabel = (, CFG.mainExtend, , , (v) CFG.mainExtend = v )
mainColorBox = (, .(, CFG.mainColor.R*, CFG.mainColor.G*, CFG.mainColor.B*), , (col)
CFG.mainColor = col
)
deflectLenFill, deflectLenKnob, deflectLenLabel = (, CFG.deflectExtend, , , (v) CFG.deflectExtend = v )
deflectColorBox = (, .(, CFG.deflectColor.R*, CFG.deflectColor.G*, CFG.deflectColor.B*), , (col)
CFG.deflectColor = col
)
toggleBtn = .()
toggleBtn.Size = .(, -, , )
toggleBtn.Position = .(, , , )
toggleBtn.BackgroundColor3 = CFG.bounceLogic .(, , ) .(, , )
toggleBtn.Font = .Font.GothamBold
toggleBtn.Text = CFG.bounceLogic
toggleBtn.TextColor3 = .(, , )
toggleBtn.TextSize =
toggleBtn.Parent = mainPage
btnCorner = .()
btnCorner.CornerRadius = .(, )
btnCorner.Parent = toggleBtn
()
toggleBtn.BackgroundColor3 = CFG.bounceLogic .(, , ) .(, , )
toggleBtn.Text = CFG.bounceLogic
toggleBtn.MouseButton1Click:(()
CFG.bounceLogic = CFG.bounceLogic
()
)
profileInput = .()
profileInput.Size = .(, -, , )
profileInput.Position = .(, , , )
profileInput.BackgroundColor3 = .(, , )
profileInput.BorderSizePixel =
profileInput.Text =
profileInput.PlaceholderText =
profileInput.TextColor3 = .(, , )
profileInput.Font = .Font.Gotham
profileInput.TextSize =
profileInput.Parent = configPage
piCorner = .()
piCorner.CornerRadius = .(, )
piCorner.Parent = profileInput
saveBtn = .()
saveBtn.Size = .(, , , )
saveBtn.Position = .(, -, , )
saveBtn.BackgroundColor3 = .(, , )
saveBtn.Font = .Font.GothamBold
saveBtn.Text =
saveBtn.TextColor3 = .(, , )
saveBtn.TextSize =
saveBtn.Parent = configPage
sbCorner = .()
sbCorner.CornerRadius = .(, )
sbCorner.Parent = saveBtn
listFrame = .()
listFrame.Size = .(, -, , -)
listFrame.Position = .(, , , )
listFrame.BackgroundTransparency =
listFrame.BorderSizePixel =
listFrame.CanvasSize = .(, , , )
listFrame.ScrollBarThickness =
listFrame.Parent = configPage
listLayout = .()
listLayout.Padding = .(, )
listLayout.SortOrder = .SortOrder.LayoutOrder
listLayout.Parent = listFrame
()
_, item (listFrame:())
item:() item:()
count =
name, data (savedProfiles)
count = count +
row = .()
row.Size = .(, -, , )
row.BackgroundColor3 = .(, , )
row.BorderSizePixel =
row.Parent = listFrame
rCorner = .()
rCorner.CornerRadius = .(, )
rCorner.Parent = row
rLabel = .()
rLabel.Size = .(, -, , )
rLabel.Position = .(, , , )
rLabel.BackgroundTransparency =
rLabel.Text = name
rLabel.TextColor3 = .(, , )
rLabel.Font = .Font.GothamSemibold
rLabel.TextSize =
rLabel.TextXAlignment = .TextXAlignment.Left
rLabel.Parent = row
loadBtn = .()
loadBtn.Size = .(, , , )
loadBtn.Position = .(, -, , -)
loadBtn.BackgroundColor3 = .(, , )
loadBtn.Font = .Font.GothamBold
loadBtn.Text =
loadBtn.TextColor3 = .(, , )
loadBtn.TextSize =
loadBtn.Parent = row
lCorner = .()
lCorner.CornerRadius = .(, )
lCorner.Parent = loadBtn
loadBtn.MouseButton1Click:(()
CFG.mainExtend = data.mainExtend
CFG.deflectExtend = data.deflectExtend
CFG.bounceLogic = data.bounceLogic
CFG.mainColor = .(data.mainColor[], data.mainColor[], data.mainColor[])
CFG.deflectColor = .(data.deflectColor[], data.deflectColor[], data.deflectColor[])
mainLenFill.Size = .(CFG.mainExtend / , , , )
mainLenKnob.Position = .(CFG.mainExtend / , -, , -)
mainLenLabel.Text = .. (CFG.mainExtend)
deflectLenFill.Size = .(CFG.deflectExtend / , , , )
deflectLenKnob.Position = .(CFG.deflectExtend / , -, , -)
deflectLenLabel.Text = .. (CFG.deflectExtend)
mainColorBox.Text = .(, CFG.mainColor.R*, CFG.mainColor.G*, CFG.mainColor.B*)
deflectColorBox.Text = .(, CFG.deflectColor.R*, CFG.deflectColor.G*, CFG.deflectColor.B*)
()
)
listFrame.CanvasSize = .(, , , count * )
saveBtn.MouseButton1Click:(()
name = profileInput.Text:(, )
name ~=
data = {
mainExtend = CFG.mainExtend,
deflectExtend = CFG.deflectExtend,
bounceLogic = CFG.bounceLogic,
mainColor = {.(CFG.mainColor.R*), .(CFG.mainColor.G*), .(CFG.mainColor.B*)},
deflectColor = {.(CFG.deflectColor.R*), .(CFG.deflectColor.G*), .(CFG.deflectColor.B*)}
}
(name, data)
profileInput.Text =
()
)
()
()
(startPos, endPos, tableFolder, ignoreLineMirror)
tableFolder
ballsFolder = tableFolder:()
ballsFolder
dir = (endPos - startPos)
dist = dir.Magnitude
dist <
raycastParams = RaycastParams.()
raycastParams.FilterType = .RaycastFilterType.Include
targets = {}
_, obj (ballsFolder:())
obj:() obj ~= ignoreLineMirror
(obj.Name)
.(targets, obj)
#targets ==
raycastParams.FilterDescendantsInstances = targets
segments =
radius =
i = , segments
frac = (i - ) / (segments - )
checkPos = startPos + (dir.Unit * (frac * dist))
result = ws:(checkPos, .(, -, ), raycastParams)
result result.Instance
(result.Instance.Position - checkPos).Magnitude < radius
mainResult = ws:(startPos, dir, raycastParams)
mainResult mainResult.Instance
(start3D, normDir3D, maxDist, tablePart, isDeflectionLine)
tablePart start3D + (normDir3D * maxDist)
tableCF = tablePart.CFrame
localStart = tableCF:(start3D)
localDir = tableCF:(normDir3D).Unit
currentPos = localStart
currentDir = localDir
remainingDist = maxDist
maxX = CFG.halfWidth -
minX = -maxX
maxZ = CFG.halfLength -
minZ = -maxZ
maxLoops = (CFG.bounceLogic isDeflectionLine)
i = , maxLoops
tX = .huge
tZ = .huge
currentDir.X > tX = (maxX - currentPos.X) / currentDir.X
currentDir.X < tX = (minX - currentPos.X) / currentDir.X
currentDir.Z > tZ = (maxZ - currentPos.Z) / currentDir.Z
currentDir.Z < tZ = (minZ - currentPos.Z) / currentDir.Z
tMin = .(tX, tZ)
tMin > tMin < remainingDist
currentPos = currentPos + currentDir * tMin
remainingDist = remainingDist - tMin
CFG.bounceLogic isDeflectionLine
remainingDist =
tMin == tX
currentDir = .(-currentDir.X, currentDir.Y, currentDir.Z)
currentDir = .(currentDir.X, currentDir.Y, -currentDir.Z)
finalLocalPos = currentPos + (currentDir * remainingDist)
tableCF:(finalLocalPos)
(part)
pos, cf = part.Position, part.CFrame
right = cf.RightVector
halfW = part.Size.X /
pos - right * halfW, pos + right * halfW
(cPart, lineMirrorPart, length, tablePart, tableFolder, alpha, isDeflectionLine, forceColorOverride)
lineMirrorPart
cPart.Transparency =
,
start3D, end3D = (lineMirrorPart)
dir3D = (end3D - start3D)
dir3D.Magnitude <
cPart.Transparency =
,
final3DTarget = (start3D, dir3D.Unit, length, tablePart, isDeflectionLine)
CFG.matchBallHeight tablePart
final3DTarget = .(final3DTarget.X, start3D.Y, final3DTarget.Z)
distance = (final3DTarget - start3D).Magnitude
distance <
cPart.Transparency =
,
isBlocked = forceColorOverride (start3D, final3DTarget, tableFolder, lineMirrorPart)
isBlocked
alternatePulse = (.(state.pulsePhase * ) + ) /
cPart.Color = CFG.warnColor:(.(, , ), alternatePulse)
cPart.Color = isDeflectionLine CFG.deflectColor CFG.mainColor
cPart.Size = .(distance, , )
cPart.CFrame = .(start3D, final3DTarget) * .(, , -distance / ) * .(, .(), )
cPart.Transparency = - alpha
final3DTarget, isBlocked
()
container container:()
._trajCleanup .()
._trajCleanup = cleanup
(a, b, t) a + (b - a) * t
rs.RenderStepped:((dt)
state.pulsePhase = state.pulsePhase + dt * CFG.pulseSpeed
pulse = (.(state.pulsePhase) + ) /
liveAlpha = (CFG.pulseMin, CFG.pulseMax, pulse)
tv = ws:()
poolsModel = ws:()
activeFelt =
activeTableFolder =
poolsModel
shortestDist = .huge
lp = Players.LocalPlayer
char = lp lp.Character
root = char char:()
root
_, folder (poolsModel:())
felt = folder:()
felt felt:()
dist = (root.Position - felt.Position).Magnitude
dist < shortestDist dist <
shortestDist = dist
activeFelt = felt
activeTableFolder = folder
tv
draw3D.main.Transparency =
draw3D.deflect.Transparency =
mainHitTarget, mainBlocked = (draw3D.main, tv:(), CFG.mainExtend, activeFelt, activeTableFolder, liveAlpha, , )
(draw3D.deflect, tv:(), CFG.deflectExtend, activeFelt, activeTableFolder, liveAlpha, , mainBlocked)
)makes the trajectory line longer for the ball