repo
stringclasses
254 values
file_path
stringlengths
29
241
code
stringlengths
100
233k
tokens
int64
14
69.4k
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/Resources/GetConsistencyData.luau
--Helper function for getting the data for checking for cosistency. --!strict local HUMANOID_PROPERTIES_TO_CHECK = { "AutoJumpEnabled", "AutoRotate", "BreakJointsOnDeath", "CameraOffset", "DisplayDistanceType", "DisplayName", "Health", "HealthDisplayDistance", "HipHeight", "Jump...
518
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/Resources/ToolListEnum.luau
--Manages the tool enum. --!strict local TOOL_CONTAINERS = { game:GetService("Lighting"), game:GetService("ReplicatedStorage"), game:GetService("ServerStorage"), game:GetService("StarterPack"), } local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) local ToolListEnum = {} ToolList...
744
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/clone.luau
--Implementation of a command. --!strict local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "clone", Category = "UsefulFunCommands", Description = "Clones the character of...
222
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/collide.luau
--Implementation of a command. --!strict local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "collide", Category = "UsefulFunCommands", Description = "Makes a set of player...
291
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/damage.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "damage", Category = "UsefulFunCommands", Description = "Damages a given set of players, ignoring force fields.", Arguments = { { Type = "nexusAdminP...
202
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/explode.luau
--Implementation of a command. --!strict local Workspace = game:GetService("Workspace") local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "explode", Category = "UsefulFunCommands", Description = "Explodes a set of players.", Arguments = { { ...
208
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/ff.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "ff", Category = "UsefulFunCommands", Description = "Adds a force field to the given players.", Arguments = { { Type = "nexusAdminPlayers", ...
228
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/fling.luau
--Implementation of a command. --!strict local Players = game:GetService("Players") local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "fling", Category = "UsefulFunCommands"...
527
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/flip.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "flip", Category = "UsefulFunCommands", Description = "Flips a set of players.", Arguments = { { Type = "nexusAdminPlayers", Name = "Play...
191
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/fly.luau
--Implementation of a command. --!strict local UserInputService = game:GetService("UserInputService") local FlyState = require(script.Parent.Parent:WaitForChild("Resources"):WaitForChild("FlyState")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "fly", Category =...
267
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/freeze.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "freeze", Category = "UsefulFunCommands", Description = "Freezes the character of the given players.", Arguments = { { Type = "nexusAdminPlayers", ...
169
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/god.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "god", Category = "UsefulFunCommands", Description = "Heals a set of players, and makes their health infinite.", Arguments = { { Type = "nexusAdminPl...
187
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/grav.luau
--Implementation of a command. --!strict local Workspace = game:GetService("Workspace") local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = {"grav", "setgrav"}, Category = "UsefulFunCommands", Description = "Sets the gravity of a set of players.", Arguments = {...
417
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/heal.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "heal", Category = "UsefulFunCommands", Description = "Heals a set of players.", Arguments = { { Type = "nexusAdminPlayers", Name = "Play...
173
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/health.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "health", Category = "UsefulFunCommands", Description = "Heals a set of players, and sets their max health.", Arguments = { { Type = "nexusAdminPlaye...
213
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/jail.luau
--Implementation of a command. --!strict local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "jail", Category = "UsefulFunCommands", Description = "Creates a jail around a ...
1,356
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/jump.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "jump", Category = "UsefulFunCommands", Description = "Jumps a set of players.", Arguments = { { Type = "nexusAdminPlayers", Name = "Play...
170
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/jumpheight.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "jumpheight", Category = "UsefulFunCommands", Description = "Sets the jump height of the given players.", Arguments = { { Type = "nexusAdminPlayers",...
228
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/jumppower.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "jumppower", Category = "UsefulFunCommands", Description = "Sets the jump power of the given players.", Arguments = { { Type = "nexusAdminPlayers", ...
228
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/kill.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "kill", Category = "UsefulFunCommands", Description = "Kills a given set of players.", Arguments = { { Type = "nexusAdminPlayers", Name =...
171
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/lock.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "lock", Category = "UsefulFunCommands", Description = "Locks the character of the given players.", Arguments = { { Type = "nexusAdminPlayers", ...
168
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/place.luau
--Implementation of a command. --!strict local TeleportService = game:GetService("TeleportService") local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "place", Category = "UsefulFunCommands", Description = "Teleports a set of players to the given place.", Argu...
181
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/sit.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "sit", Category = "UsefulFunCommands", Description = "Sits a set of players.", Arguments = { { Type = "nexusAdminPlayers", Name = "Player...
170
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/stun.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "stun", Category = "UsefulFunCommands", Description = "Stuns a set of players.", Arguments = { { Type = "nexusAdminPlayers", Name = "Play...
171
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/thaw.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = {"thaw", "unfreeze"}, Category = "UsefulFunCommands", Description = "Thaws the character of the given players.", Arguments = { { Type = "nexusAdminPl...
174
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/thru.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "thru", Category = "UsefulFunCommands", Description = "Teleports a set of players forward a given amount of studs.", Arguments = { { Type = "nexusAdm...
241
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/tp.luau
--Implementation of a command. --!strict local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "tp", Category = "UsefulFunCommands", Description = "Teleports a set of players...
366
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/tpto.luau
--Implementation of a command. --!strict local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "tpto", Category = "UsefulFunCommands", Description = "Teleports a set of playe...
267
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/uncollide.luau
--Implementation of a command. --!strict local PhysicsService = game:GetService("PhysicsService") local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "uncollide", Category = "...
599
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/unff.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "unff", Category = "UsefulFunCommands", Description = "Removes all force fields from the given players.", Arguments = { { Type = "nexusAdminPlayers",...
175
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/unfly.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) local FlyState = require(script.Parent.Parent:WaitForChild("Resources"):WaitForChild("FlyState")) return { Keyword = "unfly", Category = "UsefulFunCommands", Description = "Removes flight fro...
154
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/ungod.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "ungod", Category = "UsefulFunCommands", Description = "Sets the max health of the given players 100.", Arguments = { { Type = "nexusAdminPlayers", ...
185
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/unjail.luau
--Implementation of a command. --!strict local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "unjail", Category = "UsefulFunCommands", Description = "Unjails a set of playe...
229
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/unlock.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "unlock", Category = "UsefulFunCommands", Description = "Unlocks the character of the given players.", Arguments = { { Type = "nexusAdminPlayers", ...
168
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/unname.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "unname", Category = "UsefulFunCommands", Description = "Removes the name of a player's character from :name.", Arguments = { { Type = "nexusAdminPla...
177
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/unstun.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "unstun", Category = "UsefulFunCommands", Description = "Unstuns a set of players.", Arguments = { { Type = "nexusAdminPlayers", Name = "...
174
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/walkspeed.luau
--Implementation of a command. --!strict local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = {"walkspeed", "speed"}, Category = "UsefulFunCommands", Description = "Sets the walkspeeds of the given players.", Arguments = { { Type = "nexusAdmin...
209
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/IncludedCommands/UsefulFun/where.luau
--Implementation of a command. --!strict local IncludedCommandUtil = require(script.Parent.Parent:WaitForChild("IncludedCommandUtil")) local Types = require(script.Parent.Parent.Parent:WaitForChild("Types")) return { Keyword = "where", Category = "UsefulFunCommands", Description = "Displays the positions ...
406
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/Resources/NexusAdminClientLoader.server.luau
--Loads Nexus Admin on the client. --!strict local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local GuiService = game:GetService("GuiService") local ContextActionService = game:GetService("ContextActionService") local NexusAdminClient = require(ReplicatedStorag...
727
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/Server/Replicator.luau
--Replicates instances to players. --!strict local Players = game:GetService("Players") local StarterPlayerScripts = game:GetService("StarterPlayer"):WaitForChild("StarterPlayerScripts") local Replicator = {} Replicator.__index = Replicator export type Replicator = typeof(setmetatable({}, Replicator)) --[[ Create...
371
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/Server/ServerAuthorization.luau
--Handles users being authorized. --!strict local GROUP_LEVEL_CACHE_EXPIRE_SECONDS = 30 * 60 local Players = game:GetService("Players") local GroupService = game:GetService("GroupService") local Authorization = require(script.Parent.Parent:WaitForChild("Common"):WaitForChild("Authorization")) local Configuration = r...
1,371
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/Server/ServerFilter.luau
--Filters strings to comply with Roblox's filtering rules. --!strict local Filter = require(script.Parent.Parent:WaitForChild("Common"):WaitForChild("Filter")) local ServerFilter = {} ServerFilter.__index = ServerFilter setmetatable(ServerFilter, Filter) export type ServerFilter = typeof(setmetatable({}, ServerFilte...
917
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/Server/ServerLogsRegistry.luau
--Manages logs that are streamed to clients on the server. --!strict local Players = game:GetService("Players") local Types = require(script.Parent.Parent:WaitForChild("Types")) local ServerLogsRegistry = {} ServerLogsRegistry.__index = ServerLogsRegistry type LogDataEntry = { MinimumAdminLevel: number, Lis...
865
TheNexusAvenger/Nexus-Admin
TheNexusAvenger-Nexus-Admin-e416436/src/Server/ServerMessages.luau
--Sends messages to players. --!strict local ServerMessages = {} ServerMessages.__index = ServerMessages export type ServerMessages = { DisplayHintEvent: RemoteEvent, DisplayMessageEvent: RemoteEvent, DisplayNotificationEvent: RemoteEvent, } & typeof(setmetatable({}, ServerMessages)) --[[ Creates a ser...
447
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/.lune/build-rbxm.luau
local process = require("@lune/process") -- stylua: ignore process.exec( "rojo", { "build", "--output", "fluid.rbxm" }, { stdio = "forward" } )
48
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/.lune/build-test-place.luau
local process = require("@lune/process") process.exec( "rojo", { "build", "roblox-tests.project.json", "--output", "test-file.rbxl" }, { stdio = "forward" } )
50
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/.lune/dev.luau
local process = require("@lune/process") local task = require("@lune/task") task.spawn(function() process.exec("rojo", { "sourcemap", "roblox-tests.project.json", "--output", "sourcemap.json", "--watch", "--include-non-scripts", }, { stdio = "forward", }) end) task.spawn(function() -- stylua: ignore...
132
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/anim/lerp.luau
local graph = require("../reactive/graph") local oklab = require("../utils/oklab") local read = require("../utils/read") local types = require("../reactive/types") local active_animations = {} local function vector_lerp(a: vector, b: vector, t: number): vector return a + (b - a) * t end local function general_lerp(...
659
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/anim/spring/coefficients.luau
local function under_dampened( t: number, speed: number, damping: number ): (number, number, number, number) local alpha = speed * math.sqrt(1 - damping ^ 2) local over_alpha = 1 / alpha local exp = math.exp(-1 * t * speed * damping) local exp_sin = exp * math.sin(alpha * t) local exp_cos = exp * math.cos(alpha...
559
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/anim/spring/spring_file.luau
--[[ Temporarily named this until luau language server fixes issue ]] local coefficients = require("./coefficients") local graph = require("../../reactive/graph") local oklab = require("../../utils/oklab") local read = require("../../utils/read") local types = require("../../reactive/types") local SLEEP_VELOCITY = 1e...
1,670
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/init.luau
if _G.__DEV__ == nil then -- thanks type state _G.__DEV__ = (game and not game:GetService("RunService"):IsStudio()) :: any end local action = require("@self/instances/action") local async = require("@self/reactive/async") local bind = require("@self/instances/bind") local changed = require("@self/instances/changed")...
720
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/instances/action.luau
local action_metatable_symbol = table.freeze({}) export type Identity = setmetatable<{ callback: (inst: Instance) -> (), priority: number, }, typeof(action_metatable_symbol)> local action = { metatable = action_metatable_symbol, } function action.is_action(action: unknown): boolean return type(action) == "table"...
135
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/instances/bind.luau
local action = require("./action") local graph = require("../reactive/graph") local scheduler = require("../scheduler") local types = require("../reactive/types") local untrack = require("../reactive/untrack") type PropertyPair<T> = { tag: "property", name: string, value: T, } type ReactivePropertyPair<T> = { tag...
1,621
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/instances/changed.luau
local action = require("./action") local graph = require("../reactive/graph") local function changed(property: string, fn: (any) -> ()) return action.create(function(instance: Instance) fn((instance :: any)[property]) local con = instance:GetPropertyChangedSignal(property):Connect(function() fn((instance :: a...
97
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/instances/create.luau
local action = require("./action") local bind = require("./bind") type Instances = { AudioChannelSplitter: AudioChannelSplitter, AudioPitchShifter: AudioPitchShifter, AudioDeviceOutput: AudioDeviceOutput, AudioChannelMixer: AudioChannelMixer, AudioTextToSpeech: AudioTextToSpeech, AudioDeviceInput: AudioDeviceInp...
1,374
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/instances/for_keys.luau
local graph = require("../reactive/graph") local read = require("../utils/read") local scheduler = require("../scheduler") local types = require("../reactive/types") local function indexes<K, VI, VO>( input: types.UsedAs<{ [K]: VI }>, transform: ( () -> VI, K, active: types.Readable<boolean> ) -> (VO, number?...
1,033
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/instances/for_values.luau
local graph = require("../reactive/graph") local read = require("../utils/read") local scheduler = require("../scheduler") local types = require("../reactive/types") local function values<V, KI, KO>( input: types.UsedAs<{ [KI]: V }>, transform: ( value: V, key: () -> KI, active: types.Readable<boolean> ) -> (...
1,104
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/instances/mount.luau
local bind = require("./bind") local root = require("../reactive/root") local function mount(fn: () -> { [any]: any }, inst: Instance): () -> () return root(function() bind(inst, { fn(), }) end) end return mount
59
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/logging.luau
--!optimize 1 local colorful = require("./vendor/colorful") local scheduler = require("./scheduler") local dev_mode = _G.__DEV__ == true local warn_storage: { [string]: true } = {} local function format(text: string, is_supressed: boolean): string if is_supressed then return (string.format("[fluid][SUPRESSED]: %*...
387
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/async.luau
local graph = require("./graph") local logging = require("../logging") local task = task or require("@lune/task") type State = "busy" | "ok" --[[ async nodes creates a source node for the latest valid value and for the state. it also creates a reactive node which spawns a new thread that it runs under it's own scope....
495
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/cleanup.luau
local graph = require("./graph") local get_scope = graph.get_scope local push_cleanup = graph.push_cleanup local function helper(obj: any) return if typeof(obj) == "RBXScriptConnection" then function() obj:Disconnect() end elseif type(obj) == "thread" then function() task.cancel(obj) end elseif typeof...
337
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/deferred.luau
local graph = require("./graph") local types = require("./types") local function deferred<T>(callback: types.Effect<T>, initial_value: T) graph.set_group(graph.new_group("deferred")) local node = graph.create_reactive_node( graph.assert_stable_parent(), callback, "deferred", initial_value ) graph.evaluate...
132
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/derive.luau
local graph = require("./graph") local types = require("./types") local function derive<T>(source: types.Effect<T>): types.Readable<T> graph.set_group(graph.new_group("derive")) local node = graph.create_reactive_node(graph.assert_stable_parent(), source, "lazy") local function evaluate() local result = graph.ev...
101
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/effect.luau
local graph = require("./graph") local types = require("./types") local function effect<T>(callback: types.Effect<T>, initial_value: T) graph.set_group(graph.new_group("effect")) local node = graph.create_reactive_node(graph.assert_stable_parent(), callback, "eager", initial_value) graph.clear_group() graph.eva...
124
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/graph.luau
local logging = require("../logging") local no_yield = require("../utils/no_yield") local result = require("../result") local scheduler = require("../scheduler") local types = require("./types") local dev_mode = _G.__DEV__ == true -- groups are an internal way of organizing nodes within developer mode to enhance -- a...
3,376
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/root.luau
local graph = require("./graph") local types = require("./types") local refs: { [graph.Node<any>]: true? } = {} local function root<T...>(fn: (destroy: types.Cleanup) -> T...): (types.Cleanup, T...) graph.set_group(graph.new_group("root")) local node = graph.create_stable_node(graph.get_scope()) -- prevent gc of ...
199
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/source.luau
local graph = require("./graph") local types = require("./types") local function get_argument_from<T>(...: T): (boolean, T) if select("#", ...) == 0 then return false, nil :: any end local first_value = ... return true, first_value end local function source<T>(initial_value: T): types.Source<T> graph.set_grou...
229
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/types.luau
export type Readable<T> = () -> T export type Callable<T> = (value: T) -> () export type Effect<T> = (value: T) -> T export type Source<T> = ((T) -> T) & Readable<T> export type UsedAs<T> = T | Readable<T> export type Cleanup = () -> () return nil
78
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/reactive/untrack.luau
local graph = require("./graph") local function untrack<T>(source: () -> T): T local scope = graph.get_scope() if (not scope) or (scope and not scope.effect) then return source() end -- temporarily unbind effect local effect = scope.effect scope.effect = false :: any local value = source() scope.effect = ...
88
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/result.luau
type OkResult<T> = { success: true, value: T, } type FailResult<T> = { success: false, err: T, trace: string, } export type Identity<T, E> = OkResult<T> | FailResult<E> local function tostring_result<T>(result: FailResult<T>) return `err: {result.err}, trace: {result.trace}` end local function ok<T>(value: T)...
311
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/scheduler.luau
local task = (task or require("@lune/task")) :: typeof(task) type RenderCallback = (delta_time: number) -> () local connections: { RenderCallback } = {} local scheduler = { connections = connections, } function scheduler.step(delta_time: number) for _, callback in connections do task.spawn(callback, delta_time)...
219
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/interval.luau
local graph = require("../reactive/graph") local logging = require("../logging") local no_yield = require("./no_yield") local scheduler = require("../scheduler") local dev_mode = _G.__DEV__ == true local function interval<T>(func: (dt: number) -> T, hz: number?, offset: number?): () -> T local scope = graph.assert_s...
380
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/no_yield.luau
local fluid_yield_error = "attempted to yield in a callback" export type Error = { trace: string, message: string, yielded: boolean, } -- errors "thread is not yieldable" or "attempt to yield across metamethod/C-call boundary" -- TODO: Luau type state issue local function no_yield<T..., R...>(callback: (T...) -> R...
351
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/oklab.luau
local X_CONST = vector.create(0.4122214708, 0.5363325363, 0.0514459929) local Y_CONST = vector.create(0.2119034982, 0.6806995451, 0.1073969566) local Z_CONST = vector.create(0.0883024619, 0.2817188376, 0.6299787005) local oklab = {} function oklab.from_srgb(color: vector): vector local l = vector.dot(color, X_CONST)...
506
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/read.luau
export type function CastIntoValue(value: type) local function get_return_for_fn(t: type) local values = t:returns() local head = values.head local tail = values.tail if head then local first = head[1] return first elseif tail then return tail else return types.singleton(nil) end end if v...
236
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/show.luau
local derive = require("../reactive/derive") local read = require("./read") local types = require("../reactive/types") local untrack = require("../reactive/untrack") local function show<T, U>( condition: () -> any, truthy: types.UsedAs<T>, falsy: types.UsedAs<U>? ): () -> T | U return derive(function() if condit...
218
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/show_delay.luau
local reat = require("./read") local switch_delay = require("./switch_delay") local types = require("../reactive/types") local function show<T, U>( condition: () -> any, truthy: (active: types.Readable<boolean>) -> (T, number?), falsy: ((active: types.Readable<boolean>) -> (U, number?))? ): () -> { T | U } return ...
199
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/switch.luau
local derive = require("../reactive/derive") local read = require("./read") local types = require("../reactive/types") local untrack = require("../reactive/untrack") local function switch<T, U>(condition: () -> T) return function(options: { [T]: types.UsedAs<U> }): () -> read.CastIntoValue<U>? return derive(functio...
129
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/switch_delay.luau
local derive = require("../reactive/derive") local graph = require("../reactive/graph") local result = require("../result") local scheduler = require("../scheduler") local types = require("../reactive/types") type Condition<T> = (types.Readable<boolean>) -> (T, number?) type SwitchGraph<Result> = { previous_effect: ...
936
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/utils/tags.luau
local action = require("../instances/action") local cleanup = require("../reactive/cleanup") local graph = require("../reactive/graph") local function bind_tag(instance: Instance, tag: string) instance:AddTag(tag) cleanup(function() instance:RemoveTag(tag) end) end local function tags(tags: { string | () -> str...
185
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/src/vendor/colorful.luau
export type Styler = (text: string) -> string local function createStylerFunction(opener: number, closer: number): Styler local open = string.format("%c[%dm", 27, opener) local close = string.format("%c[%dm", 27, closer) return function(text: string) return `{open}{text}{close}` end end local function combineS...
574
ffrostfall/fluid
ffrostfall-fluid-d7ddeb0/vendor/signal.luau
--!optimize 2 --!native local task = task or require("@lune/task") local tspawn = task.spawn local cyield = coroutine.yield local freeThread: thread? = nil local function deletedSignalError() error("Cannot fire a deleted signal", 2) end local errorTable = { fire = deletedSignalError, connect = deletedSignalError...
1,341
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/client/systems/roombasHurt.luau
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Matter = require(ReplicatedStorage.Packages.Matter) local components = require(ReplicatedStorage.Shared.components) local function roombasHurt(world) for _, _, model in world:query(components.Roomba, compon...
214
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/client/systems/spinSpinners.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local components = require(ReplicatedStorage.Shared.components) local function spinSpinners(world, _, ui) if ui.checkbox("Disable Spinning"):checked() then return end local transparency = ui.slider(1) local randomize = ui.button("Randomize colors!"...
171
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/game.client.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local start = require(ReplicatedStorage.Shared.start) local receiveReplication = require(ReplicatedStorage.Client.systems.receiveReplication) local world, state = start({ ReplicatedStorage.Shared.systems, ReplicatedStorage.Client.systems, }) receiveRepl...
75
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/server/systems/mothershipsSpawnRoombas.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Matter = require(ReplicatedStorage.Packages.Matter) local components = require(ReplicatedStorage.Shared.components) local function mothershipsSpawnRoombas(world) for id, model, lasering, transform in world:query(components.Model, components.Laseri...
271
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/server/systems/removeMissingModels.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Matter = require(ReplicatedStorage.Packages.Matter) local components = require(ReplicatedStorage.Shared.components) local function removeMissingModels(world) for id, model in world:query(components.Model) do for _ in Matter.useEvent(model.model, "...
190
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/server/systems/replication.luau
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local components = require(ReplicatedStorage.Shared.components) local routes = require(ReplicatedStorage.Shared.routes) local useEvent = require(ReplicatedStorage.Packages.Matter).useEvent local REPLICATED_COMPONE...
378
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/server/systems/roombasMove.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local components = require(ReplicatedStorage.Shared.components) local function roombasMove(world) local targets = {} for _, model in world:query(components.Model, components.Target) do table.insert(targets, model.model.PrimaryPart.CFrame.p) end for ...
467
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/server/systems/spawnRoombas.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local components = require(ReplicatedStorage.Shared.components) local function spawnRoombas(world) for id, _ in world:query(components.Transform, components.Roomba):without(components.Model) do local model = ReplicatedStorage.Assets.KillerRoomba:Clone()...
119
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/shared/components.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Matter = require(ReplicatedStorage.Packages.Matter) local COMPONENTS = { "Roomba", "Model", "Charge", "Health", "Target", "Transform", "Mothership", "Lasering", "DebugLabel", "Spinner", } local components = {} for _, name in ipairs(COMPON...
107
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/shared/routes.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Packages = ReplicatedStorage.Packages type ComponentInstance<T> = T & { patch: (self: T, data: { any: any }) -> ComponentInstance<T> } local Net = require(Packages.Net) local Route = Net.Route type Route<U...> = Net.Route<U...> local defaultConfig...
133
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/shared/start.luau
local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Packages = ReplicatedStorage.Packages local Matter = require(ReplicatedStorage.Packages.Matter) local Plasma = require(Packages.Plasma) local...
594
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/examples/matter/src/shared/systems/updateModelAttribute.luau
local RunService = game:GetService("RunService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local components = require(ReplicatedStorage.Shared.components) local name = RunService:IsServer() and "serverEntityId" or "clientEntityId" local function updateModelAttribute(world) for id, record in worl...
102
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/lib/Connection.luau
type ConnectionImpl = { __index: ConnectionImpl, _callback: <U...>(U...) -> (), connected: boolean, disconnect: (Connection) -> (), reconnect: (Connection) -> (), new: <U...>(callback: (U...) -> ()) -> Connection, } export type Connection = typeof(setmetatable({} :: ConnectionImpl, {} :: ConnectionImpl)) --[...
296
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/lib/Identifier.luau
local identifier = require("@serdes/datatypes/custom/identifier") export type Identifier = buffer local function new(uniquePosition: number?): buffer return identifier.serialize(uniquePosition) end local function read(_buffer: buffer): number return identifier.deserialize(_buffer) end return { new = new, read = ...
66
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/lib/QueryResult.luau
local Bridge = require("@yetanothernet/Bridge") type Bridge = Bridge.Bridge type Recipient = Bridge.Recipient type IncomingPacket = Bridge.IncomingPacket type OutgoingPacket = Bridge.OutgoingPacket type IncomingQueue = Bridge.IncomingQueue type OutgoingQueue = Bridge.OutgoingQueue type NetServer = Bridge.NetServer ...
1,472
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/lib/SendRequest.luau
local RunService = game:GetService("RunService") local Bridge = require("@yetanothernet/Bridge") type Bridge = Bridge.Bridge type Recipient = Bridge.Recipient type IncomingPacket = Bridge.IncomingPacket type OutgoingPacket = Bridge.OutgoingPacket type IncomingQueue = Bridge.IncomingQueue type OutgoingQueue = Bridge....
392
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/lib/__tests__/Bridge.test.luau
local JestGlobals = require("@dev-packages/JestGlobals") local Bridge = require("@yetanothernet/Bridge") local beforeAll = JestGlobals.beforeAll local describe = JestGlobals.describe local expect = JestGlobals.expect local test = JestGlobals.test local jest = JestGlobals.jest local root = script.Parent.Parent local Br...
1,381
YetAnotherClown/YetAnotherNet
YetAnotherClown-YetAnotherNet-6361156/lib/__tests__/Identifier.test.luau
local JestGlobals = require("@dev-packages/JestGlobals") local describe = JestGlobals.describe local expect = JestGlobals.expect local it = JestGlobals.it local Identifier = require("@yetanothernet/Identifier") describe("Identifier", function() it("Should return unique strings", function() local identifierOne = Id...
147