Skip to content

Instantly share code, notes, and snippets.

View MaximumADHD's full-sized avatar

Max MaximumADHD

View GitHub Profile
local RunService = game:GetService("RunService")
local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")
local rootPart = humanoid.RootPart
local XZ_VECTOR3 = Vector3.new(1, 0, 1)
local lastCF = CFrame.new()
local airAccel = 0
-- Grab some services.
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
-- Make sure this is running from a LocalScript.
if not RunService:IsClient() then
error("This should be running in a LocalScript!")
end
-- Create a Sound object for the music.
@MaximumADHD
MaximumADHD / R15Ragdoll.lua
Last active November 13, 2020 15:31
Ragdoll.lua
local ragdollJoints =
{
Ankle =
{
Type = "BallSocket";
Properties =
{
UpperAngle = 20;
TwistUpperAngle = 20;
-- MockTree
-- ContextLost
-- April 25th, 2020
local MockTree = {}
MockTree.__index = MockTree
function MockTree:AddJointEdge(joint, part0, part1)
local joints = self.Joints
local edges = joints[part0]
------------------------------------------------------------------------------------------------------------------
-- CFrameSerializer.lua
-- Written by CloneTrooper1019
-- @ 3/7/2019
------------------------------------------------------------------------------------------------------------------
-- Usage
-- string CFrameSerializer:EncodeCFrame(CFrame cf) < Compresses a CFrame into a JSON string.
-- CFrame CFrameSerializer:DecodeCFrame(string cf) < Decompresses a JSON CFrame string.
------------------------------------------------------------------------------------------------------------------
-- Utility Functions
-- Tween
-- CloneTrooper1019
-- May 19th, 2020
local Tween = {}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Dependencies
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Consider using Thread instead!
-- https://gist.github.com/CloneTrooper1019/538f0ab2541ef98912a2694dd8d274e7
local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function ()
local now = tick()
local resumePool
--------------------------------------------------------------------------
-- @ CloneTrooper1019, 2020-2021
-- Thread.lua
--------------------------------------------------------------------------
local Thread = {}
--------------------------------------------------------------------------
-- Task Scheduler
--------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
-- @ CloneTrooper1019, 2021
-- Luau BinarySearchTree
------------------------------------------------------------------------------------------------------------------------------------------
local BinarySearchTree = {}
BinarySearchTree.__index = BinarySearchTree
local VALUE = 1
local LEFT_NODE = 2
---------------------------------------------------------------------------------------------------------------------------
-- XmlNode
---------------------------------------------------------------------------------------------------------------------------
local function XmlNode(class: string)
local node = Instance.new("Configuration")
node.Name = class
return function (attributes)
if next(attributes) then