Run it
Copy the script and paste it into your executor.
v2 = .new
v3 = .new
cf = .new
rad = .rad
cos = .cos
sin = .sin
abs = .abs
pi = .pi
clamp = .clamp
floor = .floor
max = .max
min = .min
sqrt = .sqrt
huge = .huge
insert = .insert
remove = .remove
rgb = .fromRGB
runservice = :()
players = :()
localplayer = players.LocalPlayer
camera = .CurrentCamera
lastlanding =
isairborne =
smoothedpositions = {}
lastcamerapos = camera.CFrame.Position
lastcameracf = camera.CFrame
cameraturnspeed =
prejumpenabled =
lastmoveinput = (, , )
smoothedprejumplines = {}
smoothedprejumpdot = (, )
time =
draw =
preddot = draw.()
preddot.Radius =
preddot.Filled =
preddot.Color = (, , )
preddot.Visible =
preddot.Transparency =
preddot.NumSides =
landdot = draw.()
landdot.Radius =
landdot.Filled =
landdot.Color = (, , )
landdot.Visible =
landdot.Transparency =
landdot.NumSides =
landoutline = draw.()
landoutline.Radius =
landoutline.Filled =
landoutline.Color = (, , )
landoutline.Visible =
landoutline.Transparency =
landoutline.Thickness =
landoutline.NumSides =
velline = draw.()
velline.Color = (, , )
velline.Thickness =
velline.Visible =
velline.Transparency =
velcurve = {}
i = ,
line = draw.()
line.Color = (, , )
line.Thickness =
line.Visible =
line.Transparency =
velcurve[i] = line
arclines = {}
i = ,
line = draw.()
line.Color = (, , )
line.Thickness =
line.Visible =
line.Transparency =
arclines[i] = line
prejumplines = {}
i = ,
line = draw.()
line.Color = (, , )
line.Thickness =
line.Visible =
line.Transparency =
prejumplines[i] = line
smoothedprejumplines[i] = {from = (, ), to = (, )}
prejumplanddot = draw.()
prejumplanddot.Radius =
prejumplanddot.Filled =
prejumplanddot.Color = (, , )
prejumplanddot.Visible =
prejumplanddot.Transparency =
prejumplanddot.NumSides =
(a, b, t)
a + (b - a) * t
(p0, v0, t)
grav = .Gravity
p0 + v0 * t + (, -grav, ) * * t * t
(pos)
screenpos, onscreen = camera:(pos)
(screenpos.X, screenpos.Y), onscreen
(pos)
rayparams = RaycastParams.()
rayparams.FilterDescendantsInstances = {localplayer.Character}
rayparams.FilterType = .RaycastFilterType.Exclude
campos = camera.CFrame.Position
dir = pos - campos
distance = dir.Magnitude
distance <
ray = :(campos, dir, rayparams)
ray (ray.Position - campos).Magnitude < distance -
(hrp)
rayparams = RaycastParams.()
rayparams.FilterDescendantsInstances = {localplayer.Character}
rayparams.FilterType = .RaycastFilterType.Exclude
ray = :(hrp.Position, (, -, ), rayparams)
ray ~=
(p0, v0)
positions = {}
prev = p0
landed =
rayparams = RaycastParams.()
rayparams.FilterDescendantsInstances = {localplayer.Character}
rayparams.FilterType = .RaycastFilterType.Exclude
t = , ,
pos = (p0, v0, t)
(positions, pos)
dir = pos - prev
dir.Magnitude >
ray = :(prev, dir, rayparams)
ray
landed = ray.Position
prev = pos
landed #positions >
last = positions[#positions]
down = :(last + (, , ), (, -, ), rayparams)
down
landed = down.Position
positions, landed
userinputservice = :()
userinputservice.InputBegan:((input, processed)
processed
input.KeyCode == .KeyCode.H
prejumpenabled = prejumpenabled
(prejumpenabled )
)
pulsetime =
conn
conn = runservice.RenderStepped:((dt)
pulsetime = pulsetime + dt
char = localplayer.Character
char char.Parent
hrp = char:()
hum = char:()
hrp hum
p0 = hrp.Position
v0 = hrp.AssemblyLinearVelocity
grounded = (hrp)
currentcf = camera.CFrame
relativecf = lastcameracf:() * currentcf
_, yaw, _ = relativecf:()
turndir = yaw / (dt, )
cameraturnspeed = cameraturnspeed * + turndir *
lastcameracf = currentcf
wasairborne = isairborne
isairborne = grounded v0.Y < -
wasairborne isairborne
lastlanding =
isairborne grounded
lastlanding =
pred3 = (p0, v0, )
pred2, predon = (pred3)
preddot.Position = pred2
preddot.Visible = predon (pred3)
v0.Magnitude >
curvature = -cameraturnspeed *
vellength = (v0.Magnitude * , )
segments =
i = , segments
t0 = (i - ) / segments
t1 = i / segments
offset0 = t0 * vellength
offset1 = t1 * vellength
curve0 = curvature * offset0 * offset0 *
curve1 = curvature * offset1 * offset1 *
dir = v0.Unit
up = (, , )
right = dir:(up).Unit
pos0 = p0 + dir * offset0 + right * curve0
pos1 = p0 + dir * offset1 + right * curve1
start2, starton = (pos0)
end2, endon = (pos1)
visible0 = (pos0)
visible1 = (pos1)
velcurve[i].From = start2
velcurve[i].To = end2
velcurve[i].Visible = starton endon visible0 visible1
velline.Visible =
velline.Visible =
i = ,
velcurve[i].Visible =
positions, landing = (p0, v0)
#positions >
i = ,
idx1 = ((i - ) * (#positions - ) / ) +
idx2 = (i * (#positions - ) / ) +
idx1 = (idx1, , #positions)
idx2 = (idx2, , #positions)
pos1 = positions[idx1]
pos2 = positions[idx2]
s1, on1 = (pos1)
s2, on2 = (pos2)
midpoint = (pos1 + pos2) *
visible = (midpoint)
arclines[i].From = s1
arclines[i].To = s2
arclines[i].Visible = on1 on2 visible
i = ,
arclines[i].Visible =
isairborne landing
lastlanding = landing
lastlanding isairborne
land2, landon = (lastlanding)
landdot.Position = land2
landdot.Visible = landon (lastlanding)
pulse = ((pulsetime * ))
landoutline.Position = land2
landoutline.Radius = + pulse *
landoutline.Transparency = + pulse *
landoutline.Visible = landon (lastlanding)
landdot.Visible =
landoutline.Visible =
prejumpenabled isairborne
camlook = camera.CFrame.LookVector
camright = camera.CFrame.RightVector
inputservice = :()
movevec = (, , )
inputservice:(.KeyCode.W)
movevec = movevec + (camlook.X, , camlook.Z).Unit
inputservice:(.KeyCode.S)
movevec = movevec - (camlook.X, , camlook.Z).Unit
inputservice:(.KeyCode.A)
movevec = movevec - (camright.X, , camright.Z).Unit
inputservice:(.KeyCode.D)
movevec = movevec + (camright.X, , camright.Z).Unit
movevec.Magnitude >
lastmoveinput = movevec.Unit
walkspeed = hum.WalkSpeed
futurevel = lastmoveinput * walkspeed
jumpvel = futurevel + (, , )
prejumppositions, prejumplanding = (p0, jumpvel)
#prejumppositions >
i = ,
idx1 = ((i - ) * (#prejumppositions - ) / ) +
idx2 = (i * (#prejumppositions - ) / ) +
idx1 = (idx1, , #prejumppositions)
idx2 = (idx2, , #prejumppositions)
pos1 = prejumppositions[idx1]
pos2 = prejumppositions[idx2]
s1, on1 = (pos1)
s2, on2 = (pos2)
midpoint = (pos1 + pos2) *
visible = (midpoint)
prejumplines[i].From = s1
prejumplines[i].To = s2
prejumplines[i].Visible = on1 on2 visible
i = ,
prejumplines[i].Visible =
prejumplanding
preland2, prelandon = (prejumplanding)
prejumplanddot.Position = preland2
prejumplanddot.Visible = prelandon (prejumplanding)
prejumplanddot.Visible =
i = ,
prejumplines[i].Visible =
prejumplanddot.Visible =
)
()
conn
conn:()
preddot:()
landdot:()
landoutline:()
velline:()
_, line (velcurve)
line:()
_, line (arclines)
line:()
_, line (prejumplines)
line:()
prejumplanddot:()
localplayer.CharacterAdded:((char)
char:().Died:(cleanup)
);();()
Universal