#anti crouch jump spam

1 messages · Page 1 of 1 (latest)

muted urchin
#

what is the difference between this and vanilla gmod?
i know gmod shifts the player's hitboxes up when they crouch jump, due to crouching pulling the bottom up

icy ravine
# muted urchin what is the difference between this and vanilla gmod? i know gmod shifts the pla...

heres the code unless chen changed something before release

if crouchJumping then
    local nextPos = mv:GetVelocity()
    nextPos:Add(physenv.GetGravity())
    nextPos:Mul(engine.TickInterval())

    local plyPos = ply:GetPos()
    local newPos = plyPos + nextPos

    local _, sMaxs = ply:GetHull()
    sMaxs.x = 0
    sMaxs.y = 0

    local cMins, cMaxs = ply:GetHullDuck()
    local endPos = newPos - sMaxs

    local hullTrace = util.TraceHull({
        start = plyPos,
        endpos = endPos,
        mins = cMins,
        maxs = cMaxs,
        mask = MASK_PLAYERSOLID,
        filter = ply
    })

    local trace = util.TraceLine({
        start = plyPos,
        endpos = endPos,
        mask = MASK_PLAYERSOLID,
        filter = ply
    })

    local total = Lerp((hullTrace.Fraction + trace.Fraction) * 0.5, 0, -cMaxs.z)

    -- TODO: Does this hook run for other players?
    ply:ManipulateBonePosition(0, Vector(0, 0, total))
end
regal pulsar
#

yeah its p much just shifting the pelvis down depending on how far away from the floor it is when crouching midair

regal pulsar
#

it would not have happened 2 years ago (when i made the script) tbh, mostly over the networking concerns

fluid glen
#

big limitation here is that bonemanips are not lagcomped, so crouchjump spam would likely still lead to bad hitreg

regal pulsar
#

certainly could be worked around by doing all the manipulation work on the client... just that'll need me to see it act reliably with pvs and whatnot in mind

fluid glen
#

from what i can tell, your code should already be doing it clientside

#

since it's shared

#

oh that means you should set networking to false

#

forgot that that's on by default

icy ravine
#

it uses a hulltrace with playersolid so itd fuck up on client anyways for players that go over props

ember token