Skip to content

Instantly share code, notes, and snippets.

@vlazed
vlazed / sh_aimvector_override.lua
Last active April 24, 2025 04:04
Allows you to use the aim vector from the client.
---@class vlazed_Player: Player Custom instance of player with extra fields
---@field ClientAimVector Vector Aim vector received from the client
---@field ShouldReceiveClientAimVector boolean Switch between the ClientAimVector or the old aim vector from GetAimVector
if CLIENT then
local sendAimConVar = CreateClientConVar("vlazed_send_aim_vector", "0", true, false, nil, 0, 1)
cvars.AddChangeCallback("vlazed_send_aim_vector", function (_, _, newValue)
local bool = isnumber(tonumber(newValue)) and tonumber(newValue) > 0 or false
net.Start("vlazed_ClientAimVectorToggle")
net.WriteBool(bool)
@vlazed
vlazed / sh_rgm_smh_sync.lua
Last active April 26, 2025 21:28
Syncs smh_motionpathbone with the selected bone from Ragdoll Mover and other things.
---@class rgmPlayer
---@field Bone integer
---@field Entity Entity
---@field rgmEntLocks {[Entity] : {[Entity]: {id: number, ent: Entity, poseid: number}}}
---@field rgmAngLocks {[Entity] : {[number]: PhysObj}}
---@field rgmPosLocks {[Entity] : {[number]: PhysObj}}
---@field rgmOffsetTable table
if CLIENT then
local THINK_INTERVAL = 0.1