Skip to content

Instantly share code, notes, and snippets.

View MaximumADHD's full-sized avatar

Max MaximumADHD

View GitHub Profile
@MaximumADHD
MaximumADHD / RunContext.luau
Last active August 10, 2024 22:39
RunContext - What's the running context of your code?
--!strict
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
local RunService = game:GetService("RunService")
local VRService = game:GetService("VRService")
local isEdit = false
local isServer = RunService:IsServer()
local isClient = RunService:IsClient()
@MaximumADHD
MaximumADHD / RobloxProfilePicture.js
Created February 16, 2024 15:18
JavaScript snippet to modify your Roblox profile picture outside the normal parameters.
$.ajax({
method: "POST",
url: "https://avatar.roblox.com/v1/avatar/thumbnail-customization",
contentType: "application/json",
data: JSON.stringify({
"camera": {
// Ranges are inclusive.
"distanceScale": 1, // 0.5 to 4 (Must be 1 for FullBody)
"fieldOfViewDeg": 45, // 15 to 45
"yRotDeg": 0 // -60 to 60
@MaximumADHD
MaximumADHD / Moonlite.lua
Created July 21, 2023 23:28
A WIP lightweight in-game player for sequences created in Moon Animator (by xSIXx)
-- Moonlite
-- Author: MaximumADHD
-- Description: A WIP lightweight in-game player for sequences created in Moon Animator (by xSIXx)
-- Version: 0.1.0
--[[
== API ==
------------------------------------`
@MaximumADHD
MaximumADHD / SelectionGet.lua
Created April 13, 2023 20:36
Autocompletes _# with game.Selection:Get()[#] in Roblox Studio's command bar.
--!strict
local ScriptEditorService = game:GetService("ScriptEditorService")
local ALIAS = "game.Selection:Get()[%s]"
type AutocompleteItem = {
label: string,
kind: Enum.CompletionItemKind?,
tags: {Enum.CompletionItemTag}?,
detail: string?,
@MaximumADHD
MaximumADHD / new_class.lua
Created April 13, 2023 17:28
Template for creating a snippet plugin with one argument in Roblox Studio.
local ScriptEditorService = game:GetService("ScriptEditorService")
local SNIPPET_NAME = "new_class"
local SNIPPET_DESC = "Create a new prototype class with an export type defined!"
local SNIPPET = table.concat({
"local ${1:%s} = {}",
"${1}.__index = ${1}",
"",
"export type Class = typeof(setmetatable({} :: {",
@MaximumADHD
MaximumADHD / Animate.lua
Last active August 7, 2024 14:21
Rewrite of Roblox's Animate script to be more flexible/robust and easier to read.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Animate
-- maximum_adhd
-- September 21st, 2022
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--!strict
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
@MaximumADHD
MaximumADHD / Bitbuf.lua
Last active December 2, 2022 02:16
Bitbuf module cleaned up and ported into Luau's strict mode.
-------------------------------------------------------------------------------------
-- Bitbuf implements a bit-level buffer, suitable for
-- serialization and storing data in-memory.
-------------------------------------------------------------------------------------
--!strict
local Bitbuf = {}
-------------------------------------------------------------------------------------
-- Internal utility functions.
--!strict
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local InsertService = game:GetService("InsertService")
local Selection = game:GetService("Selection")
local props = {
"Name",
"Color",
"CFrame",
---------------------------------------------------------------------------------------------------------------------------
-- XmlNode
---------------------------------------------------------------------------------------------------------------------------
local function XmlNode(class: string)
local node = Instance.new("Configuration")
node.Name = class
return function (attributes)
if next(attributes) then
------------------------------------------------------------------------------------------------------------------------------------------
-- @ CloneTrooper1019, 2021
-- Luau BinarySearchTree
------------------------------------------------------------------------------------------------------------------------------------------
local BinarySearchTree = {}
BinarySearchTree.__index = BinarySearchTree
local VALUE = 1
local LEFT_NODE = 2