Garry's Mod

Garry's Mod

DSteps CS:GO 2013 (feat. Landing Sounds!)
suggestion
hello! i was using this in my singleplayer while developing, and i noticed your sounds were not predicted properly for high latency

i tested this with net_fakelag 100, and it feels perfect

hook.Add("OnPlayerJump", "Footstep_JumpingSound", function(ply, speed) if IsFirstTimePredicted() and ply:GetMoveType() == MOVETYPE_WALK then if speed > 0 then local filter if SERVER then if SERVER then filter = RecipientFilter() filter:AddPAS(ply:GetPos()) filter:RemovePlayer(ply) end end ply:EmitSound("dsteps_jump", nil, nil, nil, nil, nil, nil, filter) end end end) hook.Add("OnPlayerHitGround", "Footstep_LandingSound", function(ply, inWater, onFloater, speed) if IsFirstTimePredicted() and ply:GetMoveType() == MOVETYPE_WALK then local footOffset = (0 - .5) * 15 local startPos = ply:LocalToWorld(Vector(0, footOffset, 50)) local footTr = getUnderFoot(ply,startPos,footOffset,snd) if speed > HitGroundSpeed:GetInt() then local filter if SERVER then filter = RecipientFilter() filter:AddPAS(ply:GetPos()) filter:RemovePlayer(ply) end ply:EmitSound("dsteps_land", nil, nil, nil, nil, nil, nil, filter) end end end)