Skip to content

Instantly share code, notes, and snippets.

View MaximumADHD's full-sized avatar

Max MaximumADHD

View GitHub Profile

MaximumADHD's "Smooth-Flow" Luau Style

Smooth-Flow is my nitpicky Luau coding style that encases various patterns that I've observed with how I've gone about writing and cleaning up Luau code over the past few years.

It is 99% compatible with StyLua and Roblox's Lua style guide, it just introduces some additional nitpicking and aesthetic changes to help with the readability and overall presentability of the Luau code.

Style Goals

  • Write code that groups related actions and assignments.
  • Produce aesthetically consistent code through simple rules.
@MaximumADHD
MaximumADHD / LuauTypes.d.luau
Last active June 25, 2026 04:52
Built-in Roblox Luau types (minus reflection) as of 0.700.0.7000935
-- Dump of all statically declared type annotations injected into Roblox's Luau environment.
-- This does not include anything from stock Luau or Roblox's reflection system.
----------------------------------------------
-- Offset: 7BA4E79
----------------------------------------------
-- SECTION BEGIN: RobloxGlobals
--!strict
local ScriptEditorService = game:GetService("ScriptEditorService")
local Selection = game:GetService("Selection")
local ALIAS = "game.Selection:Get()[%s]"
type AutocompleteItem = {
label: string,
kind: Enum.CompletionItemKind?,
tags: { Enum.CompletionItemTag }?,
detail: string?,
@MaximumADHD
MaximumADHD / RunContext.luau
Last active March 4, 2025 14:49
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 February 21, 2026 17:33
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.