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 |
|---|---|---|---|---|---|
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/littensy_ripple@0.9.3/ripple/src/utils/assign.luau | luau | .luau | local function assign<T>(object: T, ...: { [any]: any }): T
assert(type(object) == "table", `Expected a table for first argument, got ${type(object)}`)
for index = 1, select("#", ...) do
local source = select(index, ...)
for key, value in source do
object[key] = value
end
end
return object
end
return a... | 92 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/littensy_ripple@0.9.3/ripple/src/utils/intermediate.luau | luau | .luau | type Intermediate = { [any]: number }
local intermediates = {
number = {
to = function(value: number): Intermediate
return { value }
end,
from = function(value: Intermediate): number
return value[1]
end,
},
table = {
to = function(value: Intermediate): Intermediate
return value
end,
from = f... | 644 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/littensy_ripple@0.9.3/ripple/src/utils/merge.luau | luau | .luau | local function merge<T, U>(a: T & { [any]: any }, b: U & { [any]: any }): T & U
local copy = table.clone(a)
for key, value in pairs(b) do
copy[key] = value
end
return copy :: never
end
return merge
| 67 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/littensy_ripple@0.9.3/ripple/src/utils/snapshot.luau | luau | .luau | local HttpService = game:GetService("HttpService")
local types = require(script.Parent.Parent.types)
local createMotion = require(script.Parent.Parent.createMotion)
local STEP = 0.1
local MAX_LENGTH = 20
local function createSnapshot(solver: types.MotionSolver, length: number?)
local data: { number } = {}
local mo... | 289 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/littensy_ripple@0.9.3/ripple/src/utils/spy.luau | luau | .luau | type Spy = {
calls: number,
arguments: { { unknown } },
handle: (...any) -> (),
}
local function spy(): Spy
local self: Spy
local function handle(...)
self.calls += 1
self.arguments[self.calls] = { ... }
end
self = {
calls = 0,
arguments = {},
handle = handle,
}
return self
end
return spy
| 89 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_future@1.0.1/future/Future.luau | luau | .luau | local Spawn = require(script.Parent.Spawn)
export type Future<T...> = {
ValueList: { any }?,
AfterList: { (T...) -> () },
YieldList: { thread },
IsComplete: (self: Future<T...>) -> boolean,
IsPending: (self: Future<T...>) -> boolean,
Expect: (self: Future<T...>, Message: string) -> T...,
Unwrap: (self: Future... | 748 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/Future.lua | luau | .lua | local REQUIRED_MODULE = require(script.Parent.Parent["red-blox_future@1.0.1"]["future"])
export type Future<T...> = REQUIRED_MODULE.Future<T...>
return REQUIRED_MODULE
| 39 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/Guard.lua | luau | .lua | local REQUIRED_MODULE = require(script.Parent.Parent["red-blox_guard@1.0.1"]["guard"])
export type Check<T> = REQUIRED_MODULE.Check<T>
return REQUIRED_MODULE
| 37 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/Signal.lua | luau | .lua | local REQUIRED_MODULE = require(script.Parent.Parent["red-blox_signal@2.0.2"]["signal"])
export type Signal<T...> = REQUIRED_MODULE.Signal<T...>
return REQUIRED_MODULE
| 39 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Event/Client.luau | luau | .luau | local Spawn = require(script.Parent.Parent.Parent.Spawn)
local Net = require(script.Parent.Parent.Net)
export type Client<T...> = {
Id: string,
Unreliable: boolean,
Fire: (self: Client<T...>, T...) -> (),
On: (self: Client<T...>, Callback: (T...) -> ()) -> (),
}
local function Fire<T...>(self: Client<T...>, ..... | 236 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Event/Server.luau | luau | .luau | local Players = game:GetService("Players")
local Spawn = require(script.Parent.Parent.Parent.Spawn)
local Net = require(script.Parent.Parent.Net)
export type Server<T...> = {
Id: string,
Validate: (...unknown) -> T...,
Unreliable: boolean,
Fire: (self: Server<T...>, Player: Player, T...) -> (),
FireAll: (self... | 807 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Event/init.luau | luau | .luau | local RunService = game:GetService("RunService")
local Identifier = require(script.Parent.Identifier)
local ServerEvent = require(script.Server)
local ClientEvent = require(script.Client)
export type Event<T...> = {
Id: string,
Validate: (...unknown) -> T...,
Unreliable: boolean,
ServerEvent: ServerEvent.Serve... | 429 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Function.luau | luau | .luau | local RunService = game:GetService("RunService")
local Future = require(script.Parent.Parent.Future)
local Spawn = require(script.Parent.Parent.Spawn)
local Net = require(script.Parent.Net)
local Identifier = require(script.Parent.Identifier)
export type Function<A..., R...> = {
Id: string,
Validate: (...unknown) ... | 442 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Identifier.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Future = require(script.Parent.Parent.Future)
local Remote = ReplicatedStorage:WaitForChild("ReliableRedEvent")
local Identifier = {}
local NextShared = 0
local NextUnique = 0
local function UInt(In... | 326 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Net/Client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local ReliableRemote = ReplicatedStorage:WaitForChild("ReliableRedEvent") :: RemoteEvent
local UnreliableRemote = ReplicatedStorage:WaitForChild("UnreliableRedEvent") :: RemoteEvent
local ListenerMap: { [st... | 648 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Net/Server.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Guard = require(script.Parent.Parent.Parent.Guard)
local ReliableRemote = ReplicatedStorage:WaitForChild("ReliableRedEvent") :: RemoteEvent
local UnreliableRemote = ReplicatedStorage:WaitForChild("Unr... | 863 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/Net/init.luau | luau | .luau | return {
Server = require(script.Server),
Client = require(script.Client),
}
| 15 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_red@2.3.2/red/lib/init.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
if RunService:IsServer() then
if not ReplicatedStorage:FindFirstChild("ReliableRedEvent") then
local ReliableRemote = Instance.new("RemoteEvent")
ReliableRemote.Name = "ReliableRedEvent"
ReliableRemot... | 239 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_signal@2.0.2/signal/Signal.luau | luau | .luau | local Spawn = require(script.Parent.Spawn)
type SignalNode<T...> = {
Next: SignalNode<T...>?,
Callback: (T...) -> (),
}
export type Signal<T...> = {
Root: SignalNode<T...>?,
Connect: (self: Signal<T...>, Callback: (T...) -> ()) -> () -> (),
Wait: (self: Signal<T...>) -> T...,
Once: (self: Signal<T...>, Callbac... | 513 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/red-blox_spawn@1.1.0/spawn/Spawn.luau | luau | .luau | local FreeThreads: { thread } = {}
local function RunCallback(Callback, Thread, ...)
Callback(...)
table.insert(FreeThreads, Thread)
end
local function Yielder()
while true do
RunCallback(coroutine.yield())
end
end
return function<T...>(Callback: (T...) -> (), ...: T...)
local Thread
if #FreeThreads > 0 then... | 132 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Packages/_Index/sleitnick_trove@0.5.0/trove/init.lua | luau | .lua | -- Trove
-- Stephen Leitnick
-- October 16, 2021
local FN_MARKER = newproxy()
local THREAD_MARKER = newproxy()
local RunService = game:GetService("RunService")
local function GetObjectCleanupFunction(object, cleanupMethod)
local t = typeof(object)
if t == "function" then
return FN_MARKER
elseif t == "thread" th... | 2,494 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Server/main.server.lua | luau | .lua | --!strict
local ServerStorage = game:GetService("ServerStorage")
local Shared = game.ReplicatedStorage.Shared
local RunContext = require(Shared.RunContext)
type Service = {
Init: (Service) -> ()?,
Start: (Service) -> ()?,
}
local Services = {} :: {
[string]: Service
}
for _, desc in ServerStorage:GetDes... | 397 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/AVLTree.luau | luau | .luau | local AVLTree = {}
AVLTree.__index = AVLTree
export type Node<T = any> = {
Value: T,
Left: Node<T>?,
Right: Node<T>?,
Height: number,
}
export type Class<T = any> = typeof(setmetatable({} :: {
Root: Node<T>?,
Compare: (T, T) -> number,
_lookup: {
[T]: Node<T>,
},
_size: n... | 1,692 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/BitUtils.luau | luau | .luau | local function readf16(buf: buffer, offset: number): number
local b0 = buffer.readu8(buf, offset)
local b1 = buffer.readu8(buf, offset + 1)
local sign = bit32.btest(b0, 128) and -1 or 1
local exponent = bit32.rshift(bit32.band(b0, 127), 2)
local mantissa = bit32.lshift(bit32.band(b0, 3), 8) + b1
... | 911 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Colors.luau | luau | .luau | local Players = game:GetService("Players")
local Shared = script.Parent
local ConVar = require(Shared.ConVar)
export type IColor = Color3 | string
type ConVar = ConVar.Class
local Colors = {
Black = Color3.fromHex("#000000"),
White = Color3.fromHex("#ffffff"),
Red = Color3.fromHex("#ff0000"),
Green =... | 1,880 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/CrunchTable.luau | luau | .luau | -- CrunchTable lets you define compression schemes for simple tables to be sent by roblox
-- If a field in a table is not defined in the layout, it will be ignored and stay in the table
-- If a field in a table is not present, but is defined in the layout, it'll default to 0 (or equiv)
--!native
--!strict
local modul... | 3,479 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/DeltaTable.luau | luau | .luau | --!native
--!strict
local DeltaTable = {}
export type LazyTable = {
[any]: any,
}
export type Patch = {
Path: { string },
Value: any,
}
export type Trace = {
Path: { string },
OnApply: (path: { string }, value: any) -> (),
}
local function Deep(tbl: any): any
local tCopy = table.create(#tbl... | 1,036 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Flags.luau | luau | .luau | --!strict
local Flags = {}
Flags.__index = Flags
export type Class = typeof(setmetatable({} :: {
_value: number?,
_inst: Instance?,
_attr: string?
}, Flags))
function Flags.new(value: number?): Class
return setmetatable({
_value = value or 0
}, Flags)
end
function Flags.GetString(value: ... | 484 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Future.luau | luau | .luau | local Packages = game.ReplicatedStorage.Packages
local module = require(Packages.Future)
export type Class<T...> = module.Future<T...>
return module | 33 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Guid.luau | luau | .luau | local HttpService = game:GetService("HttpService")
local function create()
return HttpService:GenerateGUID(false)
end
local function compress(buf: buffer, offset: number, value: string)
local stream = value:gsub("-", "")
local a = tonumber(stream:sub(1, 8), 16)
buffer.writeu32(buf, offset, a or 0)
... | 427 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/JointTree.luau | luau | .luau | -- JointTree
-- ContextLost
-- April 25th, 2020
--!strict
local JointTree = {}
JointTree.__index = JointTree
type Edge = {
Part: BasePart,
Joint: JointInstance,
}
type Edges = {
[number]: Edge,
}
type Joints = {
[BasePart]: Edges
}
type CFrames = {
[BasePart]: CFrame,
}
----------------------... | 1,388 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Marketplace.luau | luau | .luau | local Shared = script.Parent
local Promise = require(Shared.Promise)
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
type Promise = Promise.Class
local ownership = {} :: {
[Player]: {
[string]: Promise
}
}
local productInfo = {} :: {
[st... | 689 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Network/init.luau | luau | .luau | local Packages = game.ReplicatedStorage.Packages
local Shared = script.Parent
local RunContext = require(Shared.RunContext)
local Network: typeof(require(Packages.Red))
if RunContext.IsEdit then
Network = require(script.mockNetwork) :: any
else
Network = require(Packages.Red)
end
return Network
| 69 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Network/mockNetwork.luau | luau | .luau | -- Edit-mode version of the Network module.
-- This dummies out the network calls so more modules can be used "safely" in edit mode.
local mockNetwork = {}
local DEBUG = false
local Shared = script.Parent.Parent
local Players = game:GetService("Players")
local StudioService = game:GetService("StudioService")
local l... | 468 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/PlayerData.luau | luau | .luau | --!strict
local PlayerData = {}
PlayerData.__index = PlayerData
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local Shared = script.Parent
local Trove = require(Shared.Trove)
local Signal = require(Shared.Signal)
local Network = require(Shared.Network)
local ... | 3,810 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/RunContext.luau | luau | .luau | --!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()
loc... | 221 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Settings/Backend/init.luau | luau | .luau | -- Add any TOML files that you want to include in the Settings table here.
return table.freeze({
Admins = require(script.Admins),
}) | 31 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Settings/EnumTypes.luau | luau | .luau | local Shared = script.Parent.Parent
local Signal = require(Shared.Signal)
type Signal<T...> = Signal.Typed<T...>
export type GetEnumImpl<Setting, Options> = (
setting: Setting,
userId: number?
) -> Options
export type SetEnumImpl<Setting, Options> = (
setting: Setting,
value: Options,
userId: num... | 169 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Settings/Types.luau | luau | .luau | -- AUTO GENERATED FILE!! DO NOT MANUALLY EDIT!!
-- Use the `Developer/CompileSettings` story to update this.
local EnumTypes = require(script.Parent.EnumTypes)
type GetEnumImpl<Setting, Options> = EnumTypes.GetEnumImpl<Setting, Options>
type SetEnumImpl<Setting, Options> = EnumTypes.SetEnumImpl<Setting, Options>
type ... | 389 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Settings/init.luau | luau | .luau | local Settings = {}
local Shared = script.Parent
local Trove = require(Shared.Trove)
local Signal = require(Shared.Signal)
local Promise = require(Shared.Promise)
local Network = require(Shared.Network)
local RunContext = require(Shared.RunContext)
local PlayerData = require(Shared.PlayerData)
local Frontend = requir... | 4,238 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Signal.luau | luau | .luau | -- Signal
-- MaximumADHD
-- November 29th, 2022
--!native
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Packages = ReplicatedStorage.Packages
local module = require(Packages.Signal)
export type Connection = module.Connection
export type Typed<T...> = module.Signal<T...>
export type ... | 165 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/StackModifier.luau | luau | .luau | -- StackModifier
-- MaximumADHD
-- March 21st, 2023
--!strict
--- A module for handling complex property stacking and modification.
--- It allows for multiple sources to modify the same property on an instance, with the ability to prioritize and weight each source.
--- Modifiers with higher priorities will override l... | 2,571 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/StringBuilder.luau | luau | .luau | local StringBuilder = {}
StringBuilder.__index = StringBuilder
export type Class = typeof(setmetatable({} :: {
_stack: number,
_lines: { string },
}, StringBuilder))
function StringBuilder.new(): Class
return setmetatable({
_stack = 0,
_lines = {},
}, StringBuilder)
end
function Strin... | 328 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Tags.luau | luau | .luau | ------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Tags
-- MaximumADHD
-- December 22nd, 2020
---------------------------------------------------------------------------------------------------------------... | 493 |
MaximumADHD/Roblox-Boilerplate | MaximumADHD-Roblox-Boilerplate-4358d1a/Shared/Trove.luau | luau | .luau | -- Trove
-- MaximumADHD
-- November 30th, 2022
--!native
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Packages = ReplicatedStorage.Packages
local Shared = ReplicatedStorage.Shared
local Trove = require(Packages.Trove)
local Signal = require(Shared.Signal)
local Promise = require(Sh... | 404 |
littensy/remo | littensy-remo-da8fe74/examples/lua/src/client/todos.client.lua | luau | .lua | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotes = require(ReplicatedStorage.Shared.remotes)
local names = require(ReplicatedStorage.Shared.names)
local todos: { string } = {}
local function addTodo()
remotes.addTodo:fire(names.getRandomName())
end
local function removeTodo()
if #todos... | 214 |
littensy/remo | littensy-remo-da8fe74/examples/lua/src/server/todos.server.lua | luau | .lua | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local remotes = require(ReplicatedStorage.Shared.remotes)
local todos: { string } = { "Milk", "Eggs" }
local changed = false
remotes.addTodo:connect(function(player, todo)
table.insert(todos, todo)
chang... | 181 |
littensy/remo | littensy-remo-da8fe74/examples/lua/src/shared/names.lua | luau | .lua | local names = {
"Milk",
"Eggs",
"Bread",
"Butter",
"Cheese",
"Bacon",
"Sausage",
"Ham",
"Chicken",
"Beef",
"Pork",
"Fish",
"Rice",
"Pasta",
"Potatoes",
"Onions",
"Garlic",
"Tomatoes",
"Carrots",
"Peppers",
"Lettuce",
"Cucumber",
"Mushrooms",
"Spinach",
"Broccoli",
"Cauliflower",
"Celery",
"A... | 540 |
littensy/remo | littensy-remo-da8fe74/examples/lua/src/shared/remotes.lua | luau | .lua | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remo = require(ReplicatedStorage.Packages.Remo)
local t = require(ReplicatedStorage.Packages.t)
type Remotes = Remo.Remotes<{
addTodo: Remo.ClientToServer<string>,
removeTodo: Remo.ClientToServer<string>,
getTodos: Remo.ServerAsync<(), ({ string ... | 171 |
littensy/remo | littensy-remo-da8fe74/examples/ts/src/server/todos.server.ts | roblox-ts | .ts | import { RunService } from "@rbxts/services";
import { remotes } from "shared/remotes";
const todos: string[] = ["Milk", "Eggs"];
let changed = false;
remotes.addTodo.connect((player, todo) => {
todos.push(todo);
changed = true;
});
remotes.removeTodo.connect((player, todo) => {
todos.remove(todos.indexOf(todo));... | 153 |
littensy/remo | littensy-remo-da8fe74/examples/ts/src/shared/remotes.ts | roblox-ts | .ts | import { Client, Server, createRemotes, loggerMiddleware, remote } from "@rbxts/remo";
import { t } from "@rbxts/t";
const todo = t.string;
const todoList = t.array(todo);
export const remotes = createRemotes(
{
// add a todo to the server
addTodo: remote<Server, [name: string]>(todo),
// remove a todo from t... | 168 |
littensy/remo | littensy-remo-da8fe74/scripts/spec.server.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TestEZ: any = require(ReplicatedStorage.DevPackages.TestEZ)
TestEZ.TestBootstrap:run({
ReplicatedStorage.Packages.Remo,
})
| 46 |
littensy/remo | littensy-remo-da8fe74/src/Promise.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local include = script:FindFirstAncestor("rbxts_include")
or script:FindFirstAncestor("include")
or ReplicatedStorage:FindFirstChild("rbxts_include")
or script.Parent.Parent
export type PromiseStatus = "Started" | "Resolved" | "Rejected" | "Cancelled"
... | 1,174 |
littensy/remo | littensy-remo-da8fe74/src/client/createRemote.luau | luau | .luau | local Promise = require(script.Parent.Parent.Promise)
local types = require(script.Parent.Parent.types)
local compose = require(script.Parent.Parent.utils.compose)
local instances = require(script.Parent.Parent.utils.instances)
local testRemote = require(script.Parent.Parent.utils.testRemote)
local function createRem... | 729 |
littensy/remo | littensy-remo-da8fe74/src/constants.luau | luau | .luau | local RunService = game:GetService("RunService")
return {
IS_EDIT = RunService:IsStudio() and not RunService:IsRunning(),
IS_STUDIO = RunService:IsStudio(),
IS_CLIENT = RunService:IsClient(),
IS_SERVER = RunService:IsServer(),
IS_TEST = false,
}
| 64 |
littensy/remo | littensy-remo-da8fe74/src/getSender.luau | luau | .luau | local constants = require(script.Parent.constants)
local function getSender(player: any): Player?
if
constants.IS_SERVER
and (type(player) == "table" or typeof(player) == "Instance")
and player.ClassName == "Player"
then
return player :: Player
end
return nil
end
return getSender
| 72 |
littensy/remo | littensy-remo-da8fe74/src/middleware/loggerMiddleware.luau | luau | .luau | local types = require(script.Parent.Parent.types)
local constants = require(script.Parent.Parent.constants)
local SCOPE = constants.IS_SERVER and "client → server" or "server → client"
local function stringify(...)
local output = {}
for index = 1, select("#", ...) do
local value = select(index, ...)
table.ins... | 317 |
littensy/remo | littensy-remo-da8fe74/src/middleware/throttleMiddleware.luau | luau | .luau | local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Promise = require(script.Parent.Parent.Promise)
local types = require(script.Parent.Parent.types)
local constants = require(script.Parent.Parent.constants)
local getSender = require(script.Parent.Parent.getSender)
local ... | 946 |
littensy/remo | littensy-remo-da8fe74/src/server/createRemote.luau | luau | .luau | local Players = game:GetService("Players")
local Promise = require(script.Parent.Parent.Promise)
local types = require(script.Parent.Parent.types)
local compose = require(script.Parent.Parent.utils.compose)
local instances = require(script.Parent.Parent.utils.instances)
local testRemote = require(script.Parent.Parent... | 676 |
littensy/remo | littensy-remo-da8fe74/src/utils/compose.luau | luau | .luau | local types = require(script.Parent.Parent.types)
local function compose(middlewares: { types.Middleware }): types.Middleware
local length = #middlewares
if length == 0 then
return function(next)
return next
end
elseif length == 1 then
return middlewares[1]
end
return function(next, ...)
for index = ... | 108 |
littensy/remo | littensy-remo-da8fe74/src/utils/instances.luau | luau | .luau | local Promise = require(script.Parent.Parent.Promise)
local constants = require(script.Parent.Parent.constants)
local mockRemotes = require(script.Parent.mockRemotes)
local container = script.Parent.Parent.container
local function promiseRemoteFunction(name: string): Promise.Promise<RemoteFunction>
if container:Find... | 415 |
littensy/remo | littensy-remo-da8fe74/src/utils/mockRemotes.luau | luau | .luau | local Players = game:GetService("Players")
local mockRemoteEvents: { [string]: RemoteEvent } = {}
local mockRemoteFunctions: { [string]: RemoteFunction } = {}
local function createMockRemoteEvent(name: string): RemoteEvent
if mockRemoteEvents[name] then
return mockRemoteEvents[name]
end
local remoteEvent: Remot... | 657 |
littensy/remo | littensy-remo-da8fe74/src/utils/testRemote.luau | luau | .luau | local types = require(script.Parent.Parent.types)
local getSender = require(script.Parent.Parent.getSender)
local function noop() end
local function createTestRemote(): types.TestRemote
local listeners: { (...any) -> () } = {}
local nextListenerId = 0
local function fire(_self, first, ...)
local shouldOmitPlaye... | 389 |
littensy/remo | littensy-remo-da8fe74/src/utils/unwrap.luau | luau | .luau | local Promise = require(script.Parent.Parent.Promise)
type Promise<T> = Promise.Promise<T>
local function unwrap<T, U...>(promise: T | Promise<T>?, ...: U...): (T, U...)
if Promise.is(promise) then
return (promise :: Promise<T>):expect()
end
return promise :: T, ...
end
return unwrap
| 75 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Animation/Tween.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A specialised state object for following a goal state smoothly over time,
using a TweenInfo to shape the motion.
https://elttob.uk/Fusion/0.3/api-reference/animation/types/tween/
]]
local Packag... | 1,344 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Animation/getTweenDuration.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Given a `tweenInfo`, returns how many seconds it will take before the tween
finishes moving. The result may be infinite if the tween repeats forever.
]]
local TweenService = game:GetService("Tween... | 174 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Animation/getTweenRatio.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Given a `tweenInfo` and `currentTime`, returns a ratio which can be used to
tween between two values over time.
]]
local TweenService = game:GetService("TweenService")
local function getTweenRati... | 336 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Animation/packType.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Packs an array of numbers into a given animatable data type.
If the type is not animatable, nil will be returned.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
local... | 842 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Animation/springCoefficients.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Returns a 2x2 matrix of coefficients for a given time, damping and angular
frequency (aka 'speed').
Specifically, this returns four coefficients - posPos, posVel, velPos, and
velVel - which can... | 740 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/External.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Abstraction layer between Fusion internals and external environments,
allowing for flexible integration with schedulers and test mocks.
]]
local Package = script.Parent
local formatError = require... | 860 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Graph/Observer.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A graph object that runs user code when it's updated by the reactive graph.
http://elttob.uk/Fusion/0.3/api-reference/state/types/observer/
]]
local Package = script.Parent.Parent
local Types = r... | 635 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/AttributeOut.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A special key for property tables, which allows users to save instance attributes
into state objects
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
local External = r... | 408 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/Child.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Helper function for type checking purposes. Casts the input to a `Child`
type, while constraining the input to be an array of `Child` - this prevents
Luau from erroneously inferring a different ar... | 126 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/Hydrate.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Processes and returns an existing instance, with options for setting
properties, event handlers and other attributes on the instance.
]]
local Package = script.Parent.Parent
local Types = require(... | 152 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/New.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Constructs and returns a new instance, with options for setting properties,
event handlers and other attributes on the instance right away.
]]
local Package = script.Parent.Parent
local Types = re... | 318 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/Out.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A special key for property tables, which allows users to extract values from
an instance into an automatically-updated Value object.
]]
local Package = script.Parent.Parent
local Types = require(P... | 439 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/Tag.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A special key for property tables, which allows users to apply custom
CollectionService tags to instances
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
-- Memory
loc... | 400 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/applyInstanceProps.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Applies a table of properties to an instance, including binding to any
given state objects and applying any special keys.
No strong reference is kept by default - special keys should take care no... | 1,039 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Instances/defaultProps.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Stores 'sensible default' properties to be applied to instances created by
the New function.
]]
return {
ScreenGui = {
ResetOnSpawn = false,
ZIndexBehavior = Enum.ZIndexBehavior.Sibling
},
... | 1,400 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Memory/checkLifetime.luau | luau | .luau |
--!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Procedures for checking lifetimes and printing helpful warnings about them.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
local External = require(Package.External)... | 958 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Memory/deriveScopeImpl.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Creates an empty scope with the same metatables as the original scope. Used
for preserving access to constructors when creating inner scopes.
This is the internal version of the function, which d... | 258 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Memory/doCleanup.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Cleans up the tasks passed in as the arguments.
A task can be any of the following:
- an Instance - will be destroyed
- an RBXScriptConnection - will be disconnected
- a function - will be run
... | 670 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Memory/insert.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Inserts clean up tasks passed in to the scope.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
local function insert<Tasks...>(
scope: Types.Scope<unknown>,
...: Task... | 117 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Memory/scoped.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Creates cleanup tables with access to constructors as methods.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
local ExternalDebug = require(Package.ExternalDebug)
loca... | 148 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/Computed.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A specialised state object for tracking single values computed from a
user-defined computation.
https://elttob.uk/Fusion/0.3/api-reference/state/types/computed/
]]
local Package = script.Parent.... | 854 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/For/Disassembly.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Breaks down an input table into reactive sub-objects for each pair.
]]
local Package = script.Parent.Parent.Parent
local Types = require(Package.Types)
local External = require(Package.External)
--... | 1,581 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/For/ForTypes.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Stores types that are commonly used between For objects.
]]
local Package = script.Parent.Parent.Parent
local Types = require(Package.Types)
export type SubObject<S, KI, KO, VI, VO> = {
-- Not al... | 272 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/For/init.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
The generic implementation for all `For` objects.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
-- Graph
local depend = require(Package.Graph.depend)
-- State
local p... | 650 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/ForKeys.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Constructs and returns a new For state object which processes keys and
preserves values.
https://elttob.uk/Fusion/0.3/api-reference/state/members/forkeys/
TODO: the sub objects constructed here... | 645 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/ForPairs.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Constructs and returns a new For state object which processes keys and
values in pairs.
https://elttob.uk/Fusion/0.3/api-reference/state/members/forpairs/
TODO: the sub objects constructed here... | 725 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/ForValues.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Constructs and returns a new For state object which processes values and
preserves keys.
https://elttob.uk/Fusion/0.3/api-reference/state/members/forvalues/
TODO: the sub objects constructed he... | 633 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/Value.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A state object which allows regular Luau code to control its value.
https://elttob.uk/Fusion/0.3/api-reference/state/types/value/
]]
local Package = script.Parent.Parent
local Types = require(Pac... | 464 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Types.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Stores common public-facing type information for Fusion APIs.
]]
export type Error = {
type: "Error",
raw: string,
message: string,
trace: string,
context: string?
}
-- Types that can be expr... | 3,296 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/isSimilar.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Implements the 'similarity test' used to determine whether two values have
a meaningful difference.
https://elttob.uk/Fusion/0.3/tutorials/best-practices/optimisation/#similarity
]]
local functi... | 208 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/merge.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Attempts to merge a variadic number of tables together.
]]
local Package = script.Parent.Parent
local External = require(Package.External)
local function merge(
overwrite: boolean,
into: {[unkno... | 196 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/init.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
The entry point for the Fusion library.
]]
local Types = require(script.Types)
local External = require(script.External)
type Fusion = Types.Fusion
export type Animatable = Types.Animatable
export... | 638 |
Epix-Incorporated/Adonis-Plugins | Epix-Incorporated-Adonis-Plugins-8629e36/Client/Client-AdonisChatAddition.luau | luau | .luau | --[==[
File: Client-AdonisChatAddition.lua
Author: Coasterteam
Description: This is a client dep. that makes it so removing custom chat works properly
Last Updated: August 11th, 2024
Version: 1.0
]==]
return function(Vargs)
local client, service = Vargs.Client, Vargs.Service
client.UI.Remove = function(name,... | 156 |
Epix-Incorporated/Adonis-Plugins | Epix-Incorporated-Adonis-Plugins-8629e36/Server/Server-AutoChannelTabs.luau | luau | .luau | --[[
Author: WalkerOfBacon
Name: Auto Channel Tabs
Description: This plugin will automatically add an "Admins" channel tab and remove unused team channel tabs.
Place in a ModuleScript under Adonis_Loader > Config > Plugins and named "Server-ChannelTab"
--]]
return function(Vargs)
local server, service = Vargs.Ser... | 564 |
Epix-Incorporated/Adonis-Plugins | Epix-Incorporated-Adonis-Plugins-8629e36/Server/Server-Banning API.luau | luau | .luau | --[[
File: Server-Banning API.lua
Author: Coasterteam
Description: A temporary addition of the Banning API to allow Adonis to communicate with it.
This plugin should be used temporarily until Adonis fully implements the rewritten moderation systems (TBD)
Last Updated: June 26th, 2024
Version: 1.0
--]]
return f... | 3,355 |
Epix-Incorporated/Adonis-Plugins | Epix-Incorporated-Adonis-Plugins-8629e36/Server/Server-CMDsCooldownByLevel.luau | luau | .luau | --!strict
----------
--[[ Info:
A plugin to automatically assign commands' cooldown depending on its rank.
]]
---------------------------------------------------------------------------------------------|
local CooldownsByLevel = {
--| Format: [AdminLevel] = {Player = <Seconds>, Server = <Seconds>, CrossServer = <S... | 346 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.