repo
stringclasses
302 values
file_path
stringlengths
18
241
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
76
697k
tokens
int64
10
271k
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Arbiter.luau
luau
.luau
--!native --!strict local Body = require("../Body") local SupportArbiter = require("./hulls/SupportArbiter") local MeshArbiter = require("./hulls/MeshArbiter") local Arbiter = {} type Body = Body.Body export type Arbiter = { -- abstract base class :3 new: (Body, Body) -> Arbiter?, update: (Arbiter, number) -> A...
175
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Contact.luau
luau
.luau
--!native --!strict local Body = require("../Body") --[[ The high level overview of what I'm doing here is basically making our old state vector[ie. the previous velocities of A and B] no longer violate a constraint. A constraint is satisfied when it is 0, or if it is a conditional constraint, when that condition...
2,618
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Hull.luau
luau
.luau
--!strict local SupportHull = require("./hulls/SupportHull") local MeshHull = require("./hulls/MeshHull") export type Hull = { -- Hull abstract base class :3 new: (...any) -> Hull, update: (Hull, CFrame, Vector3) -> (), raycast: (Hull, Vector3, Vector3) -> (number, Vector3, Vector3), -- fields support: (Vecto...
178
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/Mpr.luau
luau
.luau
--!strict --[[ MPR attempts to find a closest shape that collides with a ray. ie, like a GJK which is biased on hitting a ray. In essence, we are raycasting through the minkowski sum of an entire shape, so think of the way Quake derived games do a "box trace," which in reality, is just a raycast through an infla...
1,686
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/areHullsColliding.luau
luau
.luau
--!native --!strict --[[ This uses Casey's GJK shortcut which is optimized for yes/no intersection tests. This gives pretty poor closest point simplexes though. Works on both types of hulls. ]] local MAX_GJK_ITRS = 8 export type Support = (direction: Vector3) -> Vector3 local function tripleProduct( a: Vecto...
870
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/clipHullFaces.luau
luau
.luau
--!native --!strict --[[ Utility to clip faces to generate a proper contact manifold. This is used for the GJK/SAT hybrid, and the main SAT callback. Moreover, this optimizes our clipped verticies to only include 4 points who maximize the area of the contact manifold. This is to improve stability ]] local Hull ...
1,390
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/extractCoordinates.luau
luau
.luau
--!strict --[[ Used to get the world space offsets of feature points in the GJK/EPA subroutines ]] local EPSILON = 1e-3 export type Feature = { pA: Vector3, pB: Vector3, delta: Vector3, } local function saturate(x: number): number -- Helper clamp function return math.clamp(x, 0.0, 1.0) end local function ca...
1,059
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/getContactEpa.luau
luau
.luau
--!strict --[[ The EPA algorithm is an addition to the GJK algorithm where we can extract the minimal translation vector from a terminating GJK simplex. This is possible because(in my case atleast) GJK enclosing a point results in the simplex being a tetrahedron. The job of the EPA algorithm is to keep on sampli...
1,669
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/getContactManifold.luau
luau
.luau
--!native --!strict --[[ Gets a one-shot contact manifold between different shapes by using the separating axis theorem. ]] local Hull = require("../Hull") local clipHullFaces = require("./clipHullFaces") local COLLISION_SLOP = 1e-2 local EPSILON = 1e-3 export type MeshHull = Hull.MeshHull export type Support = ...
2,203
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/collision/getContactPersistent.luau
luau
.luau
--!strict local EPSILON = 1e-3 local GJK_MAX_ITRS = 20 local MARGIN = 0.05 local Hull = require("../Hull") local clipHullFaces = require("./clipHullFaces") --[[ The incremental strategy here is to just keep on holding onto the current normal until we can't clip anymore. From testing, this just straight up yields...
589
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/MeshArbiter.luau
luau
.luau
--!native --!strict local EPSILON = 1e-2 local getContactPersistent = require("../collision/getContactPersistent") local getContactManifold = require("../collision/getContactManifold") local areHullsColliding = require("../collision/areHullsColliding") local MeshHull = require("./MeshHull") local Contact = require("...
1,290
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/MeshHull.luau
luau
.luau
--!native --!strict --[[ Hull based off of a wavefront During collision, this uses the SAT method for stable contact manifolds ]] local EPSILON = 1e-3 local Mat3 = require("../../Mat3") local MeshHull = {} MeshHull.__index = MeshHull type Mat3 = Mat3.Mat3 -- canonical inertia tensor local INERTIA_CANONICAL = M...
3,129
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/SupportArbiter.luau
luau
.luau
--!native --!strict local getContactGjk = require("../collision/getContactGjk") local getContactEpa = require("../collision/getContactEpa") local Contact = require("../Contact") local Body = require("../../Body") export type Contact = Contact.Contact export type Body = Body.Body local SupportArbiter = {} SupportArb...
604
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/narrowphase/hulls/SupportHull.luau
luau
.luau
--!native --!strict --[[ Hull that uses support points instead of mesh stuff. Uses EPA/GJK internally. TODO: adapt the inertia tensor and volume calculations algorithms through support points! Could possibly sample the convex hull of the support points, then construct from there. ]] local Mpr = require("../Mpr...
840
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/shapes/CornerWedge.luau
luau
.luau
return [[ v 0.500000 -0.500000 0.500000 v 0.500000 -0.500000 0.500000 v -0.500000 -0.500000 0.500000 v -0.500000 -0.500000 0.500000 v 0.500000 -0.500000 -0.500000 v 0.500000 0.500000 -0.500000 v -0.500000 -0.500000 -0.500000 v -0.500000 -0.500000 -0.500000 vn -0.0000 1.0000 -0.0000 vn -0.0000 -0.0000 -1.0000 ...
418
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/shapes/Cube.luau
luau
.luau
return [[ v 0.500000 0.500000 -0.500000 v 0.500000 -0.500000 -0.500000 v 0.500000 0.500000 0.500000 v 0.500000 -0.500000 0.500000 v -0.500000 0.500000 -0.500000 v -0.500000 -0.500000 -0.500000 v -0.500000 0.500000 0.500000 v -0.500000 -0.500000 0.500000 vn 0.0000 1.0000 0.0000 vn 0.0000 0.0000 1.0000 vn -1.0...
404
magicoal-nerb/impulse
magicoal-nerb-impulse-1172c61/luau-physics/shapes/Wedge.luau
luau
.luau
return [[ v -0.500000 -0.500000 0.500000 v -0.500000 0.500000 0.500000 v -0.500000 -0.500000 -0.500000 v 0.500000 -0.500000 0.500000 v 0.500000 0.500000 0.500000 v 0.500000 -0.500000 -0.500000 vn -1.0000 -0.0000 -0.0000 vn 1.0000 -0.0000 -0.0000 vn -0.0000 -0.0000 1.0000 vn -0.0000 -1.0000 -0.0000 vn -0.0000...
314
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/docs/templates/server-operation-template.luau
luau
.luau
-- Stoway Server Operation Template -- Copy this file to src/server/StowayServerV1_2/Operations/{{OperationName}}.luau -- See docs/guides/add-server-features.html for complete instructions --// ═══════════════════════════════════════════════════════════════════════════ --// {{OperationName}}.luau --// Description: [Ad...
1,257
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/CoreState/InventoryStore.luau
luau
.luau
-- src/client/Inventory/InventoryStore.luau local ReplicatedStorage = game:GetService("ReplicatedStorage") local Fusion = require(ReplicatedStorage.Packages.fusion) local Settings = require(ReplicatedStorage.Shared.Settings) local Types = require(ReplicatedStorage.Shared.Types) local Scope = Fusion.scoped(Fusion) loca...
1,896
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/DragFunctions/DragHandler.luau
luau
.luau
local UserInputService = game:GetService("UserInputService") local GuiService = game:GetService("GuiService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local InventoryController = require(script.Parent.Parent.Operations.InventoryController) local Inv...
3,208
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/Hook/HookManager.luau
luau
.luau
-- src/client/StowayClientV1_2/Hooks/HookManager.luau -- UI-specific hook system - each UI skin provides its own hooks local HookManager = {} HookManager.__index = HookManager --// Available hook types local HOOK_TYPES = { OnSlotClick = "OnSlotClick", OnSlotHover = "OnSlotHover", OnDragStart = "OnDragStart", OnDr...
653
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/Input/ConsoleDropUI.luau
luau
.luau
local Players = game:GetService("Players") local GuiService = game:GetService("GuiService") local ConsoleDropUI = {} local container = nil local currentAmount = 1 local maxAmount = 1 local dropMenuTemplate = nil -- References local numberIndicator = nil local titleLabel = nil local decreaseButton = nil local increase...
2,964
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/Input/ConsoleModeManager.luau
luau
.luau
local GuiService = game:GetService("GuiService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local SelectionManager = require(script.Parent.SelectionManager) local InputManager = require(script.Parent.InputManager) local IllusionIAS = require(ReplicatedStorage.Packages.IllusionIAS) local Binds = req...
1,237
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/Input/InputManager.luau
luau
.luau
-- src/client/StowayClientv1_2/Input/InputManager.luau local ReplicatedStorage = game:GetService("ReplicatedStorage") local IllusionIAS = require(ReplicatedStorage.Packages.IllusionIAS) local Binds = require(ReplicatedStorage.Shared.Binds) local Settings = require(ReplicatedStorage.Shared.Settings) local InputManager ...
923
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/Input/InteractionManager.luau
luau
.luau
local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local InventoryStore = require(script.Parent.Parent.CoreState.InventoryStore) local InventoryController = require(script.Parent.Parent.Operations.Invent...
1,604
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/Input/SelectionManager.luau
luau
.luau
local GuiService = game:GetService("GuiService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local InputManager = require(script.Parent.InputManager) local InventoryController = require(script.Parent.Parent.Operations.InventoryController) local InventoryStore = require(script.Parent.Parent.CoreState....
2,412
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/NetworkFunctions/NetworkHandler.luau
luau
.luau
-- src/client/StowayClientV1_2/NetworkFunctions/NetworkHandler.luau -- Centralized Network Gateway for Inventory System V1.2 -- This module handles all server communication (incoming & outgoing) local ReplicatedStorage = game:GetService("ReplicatedStorage") local NetworkHandler = {} -- Remotes local Remotes = Replic...
286
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/Operations/InventoryController.luau
luau
.luau
-- src/client/Inventory/InventoryController.luau local ReplicatedStorage = game:GetService("ReplicatedStorage") local Store = require(script.Parent.Parent.CoreState.InventoryStore) local NetworkHandler = require(script.Parent.Parent.NetworkFunctions.NetworkHandler) local Fusion = require(ReplicatedStorage.Packages.fus...
2,903
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/SlotCreation/SlotFactory.luau
luau
.luau
-- src/client/Inventory/Components/SlotFactory.luau local ReplicatedStorage = game:GetService("ReplicatedStorage") local InventoryController = require(script.Parent.Parent.Operations.InventoryController) local RarityValues = require(ReplicatedStorage.Shared.RarityValues) local Settings = require(ReplicatedStorage.Share...
2,222
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/client/StowayClientv1_2/init.luau
luau
.luau
-- src/client/StowayClientV1_2/ClientInventoryService.luau --modules local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local StarterGui = game:GetService("StarterGui") local UserInputService = game:GetService("UserInputService") local ClientInventoryService = {} ...
4,091
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Core/InventoryState.luau
luau
.luau
-- src/server/StowayServerV1.2/Core/InventoryState.luau -- Pure data container for player inventory state -- Includes per-player settings (defaults from Config, modifiable at runtime) local ReplicatedStorage = game:GetService("ReplicatedStorage") local InventoryState = {} InventoryState.__index = InventoryState local...
614
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Core/LimitChecker.luau
luau
.luau
-- src/server/StowayServerV1.2/Core/LimitChecker.luau -- Pre-operation validation for inventory weight/limit (Amount-based) -- Uses state.Settings (per-player) instead of global Settings -- Limit = 0 means INFINITE (no weight checking) local LimitChecker = {} local SlotManager = require(script.Parent.SlotManager) --...
464
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Core/SlotManager.luau
luau
.luau
-- src/server/StowayServerV1.2/Core/SlotManager.luau -- Single source of truth for slot-level operations (Static Hotbar / Dynamic Storage) -- Uses state.Settings (per-player) instead of global Settings local SlotManager = {} local ReplicatedStorage = game:GetService("ReplicatedStorage") local Settings = require(Replic...
1,002
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Debug/ChatCommands.luau
luau
.luau
-- src/server/StowayServerV1.2/Debug/ChatCommands.luau -- Debug chat commands for testing the inventory system local ChatCommands = {} function ChatCommands.Register(player: Player, InventoryService: any) player.Chatted:Connect(function(msg) local args = string.split(msg, " ") local cmd = string.lower(args[1]) ...
3,488
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Operations/AddOperation.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local AddOperation = {} local Settings = require(ReplicatedStorage.Shared.Settings) local SlotManager = require(script.Parent.Parent.Core.SlotManager) local LimitChecker = require(script.Parent.Parent.Core.LimitChecker) local StackChecker = require(script.P...
1,877
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Operations/DropOperation.luau
luau
.luau
-- src/server/StowayServerV1.2/Operations/DropOperation.luau -- Handles Drop logic: If equipped → Unequip → Remove from inventory → Spawn in world local DropOperation = {} local SlotManager = require(script.Parent.Parent.Core.SlotManager) local RemoveOperation = require(script.Parent.RemoveOperation) local EquipOpera...
588
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Operations/RemoveOperation.luau
luau
.luau
-- src/server/StowayServerV1.2/Operations/RemoveOperation.luau -- Handles full Remove logic flow: Validate → Reduce/Destroy → Shift if Storage local RemoveOperation = {} local SlotManager = require(script.Parent.Parent.Core.SlotManager) local LimitChecker = require(script.Parent.Parent.Core.LimitChecker) export type...
821
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Operations/SwapOperation.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") -- src/server/StowayServerV1.2/Operations/SwapOperation.luau -- Handles full Swap logic flow: Validate → Execute (preserve equipped) → Return delta -- Uses state.Settings (per-player) for bounds checking local SwapOperation = {} local Settings = require(R...
974
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Replication/Replicator.luau
luau
.luau
-- src/server/StowayServerV1.2/Replication/Replicator.luau -- Centralized delta replication dispatcher local Replicator = {} local ReplicatedStorage = game:GetService("ReplicatedStorage") local Actions = require(script.Parent.Actions) -- Remote setup local RemotesFolder = ReplicatedStorage:FindFirstChild("Remotes") ...
738
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Utils/MetadataParser.luau
luau
.luau
-- src/server/StowayServerV1.2/Utils/MetadataParser.luau -- Parses metadata from Tool attributes -- Note: "Amount" is extracted separately and excluded from metadata local MetadataParser = {} local ServerStorage = game:GetService("ServerStorage") local ToolStorage = ServerStorage:FindFirstChild("Tools") :: Folder? ...
568
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Utils/StackChecker.luau
luau
.luau
-- src/server/StowayServerV1.2/Utils/StackChecker.luau -- Validates if items can stack and attempts stacking -- Uses state.Settings for CanStack and MaxStackSize (per-player) -- Uses global Settings.Stacking for item-level rules (RequiredFields, Blacklist) local StackChecker = {} local ReplicatedStorage = game:GetServ...
635
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/StowayServerV1_2/Utils/UUID.luau
luau
.luau
-- src/server/StowayServerV1.2/Utils/UUID.luau -- UUID generation utility local UUID = {} local HttpService = game:GetService("HttpService") function UUID.Generate(): string return HttpService:GenerateGUID(false) end return UUID
57
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/server/init.server.luau
luau
.luau
-- ServerScriptService/init.server.luau --// Stoway V1 Initialization -- We are transitioning to the new V1 architecture. -- The old StowayServer code is replaced by this single service entry point. local InventoryService = require(script["StowayServerV1_2"]) InventoryService.Init() print("Stoway Inventory System V...
77
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/shared/Binds.luau
luau
.luau
-- ReplicatedStorage/Shared/Binds.lua local Binds = {} -- Helper function to apply binds to an action -- Usage: Binds.ApplyToAction(action, Binds.Global.InventoryActions.Swap) -- Or: Binds.ApplyToAction(action, Binds.Global.InventoryActions.Swap, "Console") -- Console only function Binds.ApplyToAction(action, bindC...
1,026
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/shared/RarityValues.luau
luau
.luau
local rarities = {} rarities.rarityColors = { ["godly"] = Color3.new(0.933333, 0.92549, 0.435294), ["lengendary"] = Color3.new(0.639216, 0.278431, 0.278431), ["rare"] = Color3.new(0.372549, 0.607843, 0.721569), ["uncommon"] = Color3.new(0.588235, 0.72549, 0.509804), ["common"] = Color3.new(0.4, 0.4...
302
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/shared/Settings.luau
luau
.luau
-- src/server/StowayServerV1.2/Config/Settings.luau -- Configuration for the Inventory System V1.2 local Settings = {} --// Types export type HotbarType = "Static" | "Dynamic" --// Hotbar Settings Settings.Hotbar = { Type = "Static" :: HotbarType, -- Static: fixed slots with holes, Dynamic: packed array (perplayer ...
534
Zyn-ic/Stoway
Zyn-ic-Stoway-ed64b7e/src/shared/Types.luau
luau
.luau
-- ReplicatedStorage/Shared/Types.lua local Types = {} Types.HotbarType = { Static = "Static", Dynamic = "Dynamic" } Types.CarryingType = { Inventory = "Inventory", Backpack = "Backpack" } Types.SortingType = {Name = "Name", Rarity = "Rarity", ItemType = "ItemType", SearchBar = "SearchBar"} export type ItemData = { ...
179
EgoMoose/gravity-camera
EgoMoose-gravity-camera-f03b2cc/src/init.luau
luau
.luau
--!strict local Packages = script.Parent local PlayerModulePackage = require(Packages.PlayerModule) local module = {} local patched = PlayerModulePackage.getCopy(true) :: any local modifiers = require(patched.Modifiers) :: any -- Adjustments for _, modifier in script.Modifiers:GetChildren() do modifiers.add(modifi...
116
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/AutoComplete@1.13.3.luau
luau
.luau
--!strict local RunService = game:GetService("RunService") local ServerStorage = game:GetService("ServerStorage") local CollectionService = game:GetService("CollectionService") local ServerScriptService = game:GetService("ServerScriptService") local ScriptEditorService = game:GetService("ScriptEditorService") if not ...
5,939
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/Components/Dropper.luau
luau
.luau
--!strict local Types = require(script.Parent.Parent.Parent.Types) local pluginGlobalIndex: Types.pluginGlobalIndex = _G["AutoComplete+"] local module = {} function module.setupDropper(DropperButton: TextButton, DropperOptionTemplate: TextButton, SettingName: string): () local DropperOptions: { TextButton } = {} ...
343
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/Transformers.luau
luau
.luau
--!strict local Types = require(script.Parent.Types) local pluginGlobalIndex: Types.pluginGlobalIndex = _G["AutoComplete+"] local module = {} local blacklistedCharacters: { [string]: true } = {} for _, character in { " ", "-", "+", ",", ".", "/", "%", "$", "£", "&", "*", "(", ")", "'", "[", "]", "{", "}", "#", "?",...
1,324
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/Types.luau
luau
.luau
--!strict local module = {} export type ImportStyle = "PascalCase" | "camelCase" | "snake_case" export type pluginGlobalIndex = { ["ServiceImportStyle"]: ImportStyle, ["ModuleImportStyle"]: ImportStyle, ["InstanceImportStyle"]: ImportStyle, ["SuggestionCharacter"]: string?, ["SnippetCharacter"]: string?, ["Co...
307
KinderBarrel/AutoCompletePlus
KinderBarrel-AutoCompletePlus-94dc192/src/UI.luau
luau
.luau
--!strict local Types = require(script.Parent.Types) local Dropper = require(script.Components.Dropper) local DropperOptionTemplate = script.Templates.DropperOptionTemplate local pluginGlobalIndex: Types.pluginGlobalIndex = _G["AutoComplete+"] local module = {} function module.Setup(): () local DockWidgetPluginGu...
534
AlexanderLindholt/PacketPlus
AlexanderLindholt-PacketPlus-e844b14/source/Task.luau
luau
.luau
--!optimize 2 local threads = {} local function reusableThreadCall(callback, thread, ...) callback(...) table.insert(threads, thread) end local function reusableThread() while true do reusableThreadCall(coroutine.yield()) end end return { Spawn = function(callback, ...) local length = #threads if length ==...
334
AlexanderLindholt/PacketPlus
AlexanderLindholt-PacketPlus-e844b14/source/Types.luau
luau
.luau
--!optimize 2 --!native --[[ S8 Minimum: -128 Maximum: 127 S16 Minimum: -32768 Maximum: 32767 S24 Minimum: -8388608 Maximum: 8388607 S32 Minimum: -2147483648 Maximum: 2147483647 U8 Minimum: 0 Maximum: 255 U16 Minimum: 0 Maximum: 65535 U24 Minimum: 0 Maximum: 16777215 U32 Minimum: 0 Ma...
9,376
LDGerrits/Bootstrapper
LDGerrits-Bootstrapper-8138822/src/init.luau
luau
.luau
--!strict --v1.2.0 • LDGerrits --[=[ @class Bootstrapper A lightweight, agnostic module loader and scheduler for Roblox. Eliminate load-order bugs and race conditions by organizing your modules into a deterministic pipeline. Define exactly what runs, and in what order, every single frame with zero ambiguity. ]=] ...
5,140
depthso/Roblox-ImGUI
depthso-Roblox-ImGUI-876b997/ImGui.lua
luau
.lua
--// Written by depso --// MIT License --// Copyright (c) 2024 Depso local ImGui = { Animations = { Buttons = { MouseEnter = { BackgroundTransparency = 0.5, }, MouseLeave = { BackgroundTransparency = 0.7, } }, Tabs = { MouseEnter = { BackgroundTransparency = 0.5, }, MouseLeave ...
11,395
omrezkeypie/BinaryOctree
omrezkeypie-BinaryOctree-6253a82/benchmarks/QueryingBench.luau
luau
.luau
--!optimize 2 --[[ This file is for use by Benchmarker (https://boatbomber.itch.io/benchmarker) |WARNING| THIS RUNS IN YOUR REAL ENVIRONMENT. |WARNING| --]] local BinaryOctreeModule = require("path to binary octree") local SleitnickModule = require("path to sleitnicks module") local Dot = Vector3.zero.Dot local Oct...
427
omrezkeypie/BinaryOctree
omrezkeypie-BinaryOctree-6253a82/src/init.luau
luau
.luau
--!optimize 2 --!native type Object = { Position: Vector3 } export type BinaryOctree = { MaxDepth: number?, Size: number, OffsetPosition : Vector3?, Nodes: {{Object}}, } type Module = { new: (Size: number, MaxDepth: number?,OffsetPosition : Vector3?) -> BinaryOctree, InsertObjects: (BinaryOctree: BinaryOctree...
2,835
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/.lune/build.luau
luau
.luau
local process = require("@lune/process") local INIT_PATH = "src/init.luau" local BUNDLE_PATH = "bin/PNGuin.luau" local RBXM_PATH = "bin/PNGuin.rbxm" local function buildPesde() local result = process.exec("darklua", {"process", INIT_PATH, BUNDLE_PATH}) assert(result.ok, result.stderr) end local function buildRBXM...
145
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/.lune/bump.luau
luau
.luau
local process = require("@lune/process") local fs = require("@lune/fs") local serde = require("@lune/serde") local PESDE_CONFIG_PATH = "pesde.toml" local function writeVersion(version: string) local data = fs.readFile(PESDE_CONFIG_PATH) local config: {version: string} = serde.decode("toml", data) config.version = ...
150
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/Decoding/HuffmanTree.luau
luau
.luau
--!strict --!native --!optimize 2 local BitStream = require("../Parsing/BitStream") type BitStream = BitStream.BitStream type HuffmanNode = { [number]: HuffmanNode } & {sym: number?} export type HuffmanTree = { root: HuffmanNode, Read: (self: HuffmanTree, stream: BitStream) -> number } local function Read(self...
606
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/Decoding/Parser.luau
luau
.luau
--!strict --!native --!optimize 2 local BitStream = require("../Parsing/BitStream") type BitStream = BitStream.BitStream export type Parser = { _output: buffer, _outputPos: number, _outputChunks: {buffer}, window: buffer, windowPos: number, windowSize: number, stream: BitStream, ToOutput: (self: Parser, v...
1,050
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/Decoding/Zlib.luau
luau
.luau
--!strict --!native --!optimize 2 local HuffmanTree = require("../Decoding/HuffmanTree") local Parser = require("../Decoding/Parser") local BitStream = require("../Parsing/BitStream") type BitStream = BitStream.BitStream type HuffmanTree = HuffmanTree.HuffmanTree type Parser = Parser.Parser local lenBase = { 3, 4,...
1,735
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/Parsing/BitStream.luau
luau
.luau
--!strict --!native --!optimize 2 export type BitStream = { data: buffer, len: number, pos: number, offset: number, Bits: (self: BitStream, width: number) -> number, UInt: (self: BitStream, width: number) -> number, String: (self: BitStream, length: number) -> string, Align: (self: BitStream) -> () } local r...
430
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/Parsing/ByteStream.luau
luau
.luau
--!strict --!native --!optimize 2 export type ByteStream = { data: buffer, len: number, pos: number, UInt: (self: ByteStream, width: number, big: boolean?) -> number, String: (self: ByteStream, length: number) -> string, } local readMap = { [1] = buffer.readu8, [2] = buffer.readu16, [4] = buffer.readu32 } ...
262
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/Parsing/ChunkStream.luau
luau
.luau
--!strict --!native --!optimize 2 local Types = require("../Types") local ByteStream = require("../Parsing/ByteStream") type PNGInfo = Types.PNGInfo type ColorType = Types.ColorType type ByteStream = ByteStream.ByteStream export type ChunkStream = { info: PNGInfo, stream: ByteStream, Read: (self: ChunkStream, ch...
993
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/Types.luau
luau
.luau
--!strict --!optimize 2 export type PNGInfo = { IDAT: buffer, PLTE: buffer, tRNS: buffer?, width: number, height: number, bitDepth: number, colorType: ColorType, hasAlpha: boolean, channels: number, --[=[ Decodes IDAT chunks into (RGBA) pixel data @within PNGInfo @return buffer -- Pixel data @re...
147
LiterallyWize/pnguin
LiterallyWize-pnguin-42c5e35/src/init.luau
luau
.luau
--!strict --!native --!optimize 2 local Types = require("@self/Types") local ChunkStream = require("@self/Parsing/ChunkStream") local ByteStream = require("@self/Parsing/ByteStream") local Zlib = require("@self/Decoding/Zlib") local Filter = require("@self/Decoding/Filter") type PNGInfo = Types.PNGInfo local PNGuin ...
490
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/RegisteredComponents.luau
luau
.luau
local Package = script.Parent local Packages = Package.Parent local React = require(Packages.React) local Signal = require(Packages.Signal) --[=[ A React component. @type Component ReactComponent<unknown> @within ReactMatter ]=] export type Component = React.ComponentType<unknown> --[=[ A mapping of component k...
250
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/components/SystemComponent.luau
luau
.luau
local Package = script.Parent.Parent local Packages = Package.Parent local Contexts = Package.contexts local Params = require(Contexts.Params) local React = require(Packages.React) local Return = require(Contexts.Return) local Signal = require(Packages.Signal) local e = React.createElement local useEffect = React.use...
1,045
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/contexts/Params.luau
luau
.luau
local Package = script.Parent.Parent local Packages = Package.Parent local React = require(Packages.React) export type ParamType<T> = T & {} export type Params<T> = { params: ParamType<T>?, } local defaultParams: Params<unknown> = {} local Params = React.createContext(defaultParams) return Params
68
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/contexts/Return.luau
luau
.luau
local Package = script.Parent.Parent local Packages = Package.Parent local React = require(Packages.React) --[=[ Updates the return value of a system component. @type UpdateReturn<T> (value: T | (value: T?) -> T) -> () @within ReactMatter ]=] export type UpdateReturn<T> = (value: T | (value: T?) -> T) -> () expo...
124
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/diffTables.luau
luau
.luau
local function diffTables(left: { [unknown]: unknown }?, right: { [unknown]: unknown }?): boolean if left and right then if left == right then return false end local size = 0 for key, value in left do if value ~= right[key] then return true end size += 1 end for _ in right do size -= ...
131
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/example.luau
luau
.luau
local Package = script.Parent local Packages = Package.Parent local Hooks = Package.hooks local React = require(Packages.React) local useParams = require(Hooks.useParams) local useReact = require(Package.useReact) local useReturn = require(Hooks.useReturn) local e = React.createElement local Fragment = React.Fragment...
402
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/hooks/useParams.luau
luau
.luau
local Package = script.Parent.Parent local Packages = Package.Parent local Contexts = Package.contexts local Params = require(Contexts.Params) local React = require(Packages.React) local useContext = React.useContext --[=[ Retrieves the parameters passed to a system component. This is a hook that can only be call...
327
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/hooks/useReturn.luau
luau
.luau
local Package = script.Parent.Parent local Packages = Package.Parent local Contexts = Package.contexts local React = require(Packages.React) local Return = require(Contexts.Return) local useContext = React.useContext export type UpdateReturn<T> = Return.UpdateReturn<T> --[=[ Retrieves the update function for the r...
257
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/init.luau
luau
.luau
local RenderSystems = require(script.components.RenderSystems) local useParams = require(script.hooks.useParams) local useReact = require(script.useReact) local useReturn = require(script.hooks.useReturn) export type Component = useReact.Component export type Components = useReact.Components export type Complete<T> = ...
180
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/lib/useReact.luau
luau
.luau
local Package = script.Parent local Packages = Package.Parent local Components = Package.components local Matter = require(Packages.Matter) local RegisteredComponents = require(Package.RegisteredComponents) local Signal = require(Packages.Signal) local SystemComponent = require(Components.SystemComponent) local diffTa...
879
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/tests/runners/roots.luau
luau
.luau
local rootTree = require(script.Parent.rootTree) local function getRoots(node, parent) local roots = {} for key, subNode in node do local subRoots = getRoots(subNode, parent:FindFirstChild(key) or error("Could not find child" .. key)) table.move(subRoots, 1, #subRoots + 1, #roots + 1, roots) end if #roots...
190
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/tests/runners/run.server.luau
luau
.luau
local roots = require(script.Parent.roots) local test = require(script.Parent.tests) local completed, result = test(roots) if completed then if not result then error("Tests have failed.", 0) end else error(result, 0) end
57
matter-ecs/react-matter
matter-ecs-react-matter-ad211ea/tests/runners/tests.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local TestEZ = require(ReplicatedStorage.DevPackages.TestEZ) local function test(roots) print() local completed, result = xpcall(function() local results = TestEZ.TestBootstrap.run(roots) return results.failureCount == 0 end, debug.traceback) print...
84
KalaYoScripting/Ember
KalaYoScripting-Ember-5e7bbb1/source/Init.luau
luau
.luau
--// Properties //-- local ALERT_ABOUT_FLIPBOOK_DIMENSIONS = true local REDUCE_RATE_BY_QUALITY = true local DELTA_TIME = nil -- leave nil if you want to use user framerate --// Types //-- export type ParticleEmitter2D = ParticleEmitter & { EmitPosition: UDim2, EmitParent: GuiObject?, FlipbookDimensions: number?, ...
5,212
78n/Roblox
78n-Roblox-8f6f7c6/Lua/Libraries/DataToCode/DataTypes.luau
luau
.luau
local DataTypes = { Axes = Axes.new(), BrickColor = BrickColor.Random(), CellId = CellId.new(), CFrame = CFrame.identity, CatalogSearchParams = CatalogSearchParams.new(), Color3 = Color3.new(), ColorSequence = ColorSequence.new(Color3.new()), ColorSequenceKeypoint = ColorSequenceKeypoint.new(0, Color3.new()), ...
758
4lpaca-pin/NeverLose
4lpaca-pin-NeverLose-2bf6391/module.luau
luau
.luau
-- Synchronization Interface -- cloneref = cloneref or function(f) return f; end; local SyncManager = {}; local CoreGui = cloneref(game:GetService('CoreGui')); SyncManager.Players = {}; SyncManager.RenderValue = false; SyncManager.Thread = nil; SyncManager.Icon = "rbxassetid://120358385035996"; function SyncManager:...
479
seaofvoices/luau-character
seaofvoices-luau-character-5225cac/src/__tests__/casing.test.luau
luau
.luau
local jestGlobals = require('@pkg/@jsdotlua/jest-globals') local character = require('../character') local expect = jestGlobals.expect local it = jestGlobals.it local describe = jestGlobals.describe local TO_UPPER_CASES = { { 'a', 'A' }, { 'i', 'I' }, { 'á', 'Á' }, { 'ã', 'Ã' }, { 'ç', 'Ç' }, ...
932
seaofvoices/luau-character
seaofvoices-luau-character-5225cac/src/slice.luau
luau
.luau
local function binarySeachBy<T>(array: { T }, fn: (value: T) -> number): { ok: boolean, index: number } local size = #array if size == 0 then return { ok = false, index = 1 } end local base = 1 while size > 1 do local half = math.floor(size / 2) local mid = base + half ...
287
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/DefaultModules/Bool.lua
luau
.lua
local __Types = require(script.Parent.Parent.__Types) export type Module = { Get: () -> boolean, Set: (value: boolean) -> (), Flip: () -> (), SetFalse: () -> (), SetTrue: () -> () } --[[ Type for the Cereberal Bool Default Module ]] -- Skip out on Name, Value, New, GetSafe, Set export type BoolMo...
332
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/DefaultModules/Number.lua
luau
.lua
--!strict -- Constants -- -- Do we need integer overflow protection? --Dependencies -- local __Types = require(script.Parent.Parent.__Types) -- Private -- type Module = { Get: () -> number, Increment: (number) -> number, Decrement: (number) -> number, Zero: () -> (), Multiply: (number) -> (), Divide: (number) ...
709
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/DefaultModules/String.lua
luau
.lua
local __Types = require(script.Parent.Parent.__Types) type Module = { Get: () -> string, Set: (value: string) -> string, GetLen: () -> number, Lower: () -> string, Upper: () -> string, Concat: (value: string) -> string } export type StringModule = __Types.Attribute<Module, string> local String = {} String.__i...
290
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/DefaultModules/Table.lua
luau
.lua
-- !optimize 2 -- !strict local __Types = require(script.Parent.Parent.__Types) export type Module = { Get: () -> table, Set: () -> table, Update:(callback: (oldvalue: {}) -> {}) -> table } export type TableModule = __Types.Attribute<Module, table> local Table = {} Table.__index = Table Table.Name = nil...
304
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/DefaultModules/init.luau
luau
.luau
local Bool = require(script.Bool) local Number = require(script.Number) local String = require(script.String) local Table = require(script.Table) export type BoolModule = Bool.BoolModule export type NumberModule = Number.NumberModule export type StringModule = String.StringModule export type TableModule = Table.TableM...
86
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/__Agent.luau
luau
.luau
--!strict -- Dependencies -- local Types = require(script.Parent.__Types) local DataStore = require(script.Parent.__DataStore) -- Constants -- -- Types -- export type Agent = Types.Agent & { player: Player, ds_data: {[string]: Types.JSONAcceptable}, AddAttribute: (self: Agent, class: any, initialValue: any, name:...
1,450
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/__DataStore.luau
luau
.luau
--!strict --!optimize 2 -- Dependencies -- local DataStoreService = game:GetService("DataStoreService") local Types = require(script.Parent.__Types) -- Constants -- local MAX_ATTEMPTS = 10 local RETRY_TIME = 0.2 local DATA_STORE_NAME = "Cerebral_DB" -- Private -- local function waitOnDataStore(ds_service: DataStore...
666
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/__Packages/init.lua
luau
.lua
--[[ __Packages is not really a package directory. It is no like node_modules to Node.js. Instead, this directory harbors variours code snippets I come across in the Luau community (proper license of course). ]] local Signal = require(script.Signal) local Packages = { Signal = Signal -- Handles Luau event signals...
74
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/__Types.luau
luau
.luau
local DataStoreService = game:GetService("DataStoreService") export type JSONAcceptable = { JSONAcceptable } | { [string]: JSONAcceptable } | number | string | boolean | buffer export type Attribute<A, B> = typeof(setmetatable({}, {})) & { Name: string, Value: B, __Subscribed: boolean, New: (...any) -> A, GetSafe...
453
CerebralLabs/cerebral
CerebralLabs-cerebral-56b4c3f/src/init.luau
luau
.luau
--!optimize 2 --!strict -- Constants -- local AGENT_FOLDER = "__Data" local AUTO_SAVE_PERIOD = 60 --- Constant Type ---- type Constants = "AGENT_FOLDER" | "AUTO_SAVE_PERIOD" -- Dependencies -- local DefaultModules = require(script.DefaultModules) local Signal = require(script.__Packages.Signal) local Types = require...
1,828
arindam-codes/roblox-scripting-practices
arindam-codes-roblox-scripting-practices-8cbeb05/src/client/init.client.luau
luau
.luau
------------------------------------------------------------------------------------------------------------------- ---- understading of errors of infinte yield, nill, timeout ------------------------------------------------------- ----------------------------------------------------------------------------------------...
674
arindam-codes/roblox-scripting-practices
arindam-codes-roblox-scripting-practices-8cbeb05/src/server/day2.server.luau
luau
.luau
--[[ local table1 = {1, 2, 3} local table2 = {4, 5, 6} local metatable = { __add = function(table1, table2) local elements = {} for i in ipairs(table1) do elements[i] = table1[i] + table2[i] end return elements end } setmetatable(table1, metatable) setmet...
842
arindam-codes/roblox-scripting-practices
arindam-codes-roblox-scripting-practices-8cbeb05/src/server/init.server.luau
luau
.luau
--[[local function calaculateDamege(baseDamage, multiplier) return baseDamage * multiplier end print(calaculateDamege(10, 2)) -- Output: 20 --[[for i = 1, 20, 1 do if i % 3 == 0 and i % 5 == 0 then print("FizzBuzz") elseif i % 5 ==0 then print("Buzz") elseif i % 3 == 0 then prin...
265