Skip to content

Instantly share code, notes, and snippets.

View dhkatz's full-sized avatar
🏠
Working from home

David Katz dhkatz

🏠
Working from home
View GitHub Profile
@dhkatz
dhkatz / door_attach_debug.lua
Last active September 20, 2018 05:30
Debug Door Attaching
CreateClientConVar("pd2_drill_debug", "0", true, false, "Draw Payday 2 Drill debug information.")
local doors = { ["prop_door_rotating"] = true, ["func_door"] = true, ["func_door_rotating"] = true }
hook.Add("PostDrawTranslucentRenderables", "DoorPos", function()
if not cvars.Bool("pd2_drill_debug") then return end
-- Find the drill we're working with
local drill = NULL
for _, e in ipairs(ents.FindInSphere(LocalPlayer():GetPos(), 500)) do
if e:GetClass() == "pd2_drill" then
@dhkatz
dhkatz / boss_framework.lua
Last active September 14, 2018 05:13
Garry's Mod Boss Framework
-- Put in either addons/boss_framework/lua/autorun/boss_framework.lua or just lua/autorun/boss_framework.lua
if SERVER then
local BossEnabled = CreateConVar("boss_enabled", "1", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Enable/disable the boss system.")
local BossCooldown = CreateConVar("boss_cooldown", "300", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Cooldown between when a boss can even possibly spawn.")
local BossThreshold = CreateConVar("boss_threshold", "1", {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Number of players required for a boss to spawn.")
AddCSLuaFile()
--------------------
@dhkatz
dhkatz / App.vue
Last active June 27, 2019 19:31
Garry's Mod Vue.js Example
<template>
<div id="app">
<Vitals ref="vitals" id="vitals"></Vitals>
</div>
</template>
<script>
import Vitals from './components/Vitals.vue';
export default {
name: 'app',
@dhkatz
dhkatz / guide.md
Last active October 6, 2018 21:30
Improved A-Wing on the new SWVR Base

Star Wars Vehicles: Redux

Introduction

With SWVR, all your code is designed to be put inside ENT:Initialize() and there only. If you find yourself having to write code elsewhere (such as overriding functions), then the base is missing a feature! Message me to get it added ASAP.

Because of this, assume ALL code examples below are inside of ENT:Initialize()

Setting Up

### Keybase proof
I hereby claim:
* I am doctorjew on github.
* I am dhkatz (https://keybase.io/dhkatz) on keybase.
* I have a public key ASCNnx3FjHuOII6TLsvslaLS7wHc2lreiygot-r0LS9zygo
To claim this, I am signing this object:
@dhkatz
dhkatz / swe_spawner.lua
Last active September 24, 2017 05:32
Spawn NPCs with a custom class and/or playermodel using a tool. Install to "garrysmod\lua\weapons\gmod_tool\stools"
TOOL.Category = "Event"
TOOL.Name = "Spawner"
TOOL.ClientConVar["type"] = "npc_citizen"
TOOL.ClientConVar["health"] = "500"
TOOL.ClientConVar["weapon"] = "none"
TOOL.ClientConVar["model"] = ""
TOOL.ClientConVar["proficiency"] = "AVERAGE"
TOOL.Information = {
{