repo stringclasses 350
values | file_path stringlengths 29 200 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.01M | tokens int64 2 598k |
|---|---|---|---|---|---|
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Frontend/Widgets/PrimaryToolbar.luau | luau | .luau | local React = require("@pkgs/React")
local IconMap = require("@root/Assets/IconMap")
local LocalStore = require("@root/Stores/LocalStore")
local Preferences = require("@root/Stores/Preferences")
local Button = require("../Components/Button")
local ComponentGroup = require("../Components/ComponentGroup")
local Divider... | 1,603 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Frontend/Widgets/SettingsWidget.luau | luau | .luau | local plugin: Plugin = plugin or script:FindFirstAncestorOfClass("Plugin")
local StudioService = game:GetService("StudioService")
local RuntimeScript = script.Parent.Parent.Parent
local React = require("@pkgs/React")
local LocalStore = require("@root/Stores/LocalStore")
local Manifest = require("@root/Manifest")
loc... | 3,817 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Frontend/Widgets/SurfacePickerWidget.luau | luau | .luau | local UserInputService = game:GetService("UserInputService")
local Array = require("@root/Lib/Array")
local React = require("@pkgs/React")
local IconMap = require("@root/Assets/IconMap")
local LocalStore = require("@root/Stores/LocalStore")
local Preferences = require("@root/Stores/Preferences")
local Button = requi... | 1,325 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Lib/Array.luau | luau | .luau | --!strict
local function filter<T>(array: { T }, predicate: (value: T, index: number) -> any): { T }
local output = {}
for index, value in array do
if predicate(value, index) then
table.insert(output, value)
end
end
return output
end
local function map<T, U>(array: { T }, mapper: (value: T, index: number)... | 154 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Lib/Store.luau | luau | .luau | export type Value<T> =
((value: (T | (current: T) -> T)?, bypassSignals: boolean?) -> T)
& {
changed: RBXScriptSignal<T, T>,
initialValue: T,
destroy: () -> (),
reset: () -> (),
onChange: (prev: T, next: T) -> () -> (),
onReset: (() -> ())?,
}
local function Value<T>(
value: T,
api: {
validate: ((va... | 603 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Lib/createUniqueKey.luau | luau | .luau | local function createUniqueKey(existingNames: { any }?)
local names = {}
if existingNames then
for _, name in existingNames do
local stringified = tostring(name)
if names[stringified] == nil then
names[stringified] = 1
else
names[stringified] += 1
end
end
end
return function(name: any): s... | 172 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Manifest.luau | luau | .luau | local WallyManifest = require(script.Parent.WallyPackageManifest) :: WallyManifest
type WallyManifest = {
package: {
name: string,
realm: string,
registry: string,
version: string,
},
dependencies: {
[string]: string,
},
product: {
description: string,
display_name: string,
},
}
return WallyManife... | 86 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/ResurfaceApi.luau | luau | .luau | local ChangeHistoryService = game:GetService("ChangeHistoryService")
local MaterialService = game:GetService("MaterialService")
local MaterialVariants = require("@root/Assets/MaterialVariants")
local createUniqueKey = require("@root/Lib/createUniqueKey")
local NORMAL_IDS: { Enum.NormalId } = Enum.NormalId:GetEnumIte... | 1,568 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Stores/LocalStore.luau | luau | .luau | local plugin: Plugin = plugin or script:FindFirstAncestorOfClass("Plugin")
local Store = require("@root/Lib/Store")
local Value = Store.Value
type Value<T> = Store.Value<T>
local validWidgetIds = {
settings = true,
surfacePicker = true,
}
local store = {
isPluginActive = Value(false),
currentWidget = Value(nil,... | 214 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/Stores/Preferences.luau | luau | .luau | local Store = require("@root/Lib/Store")
local Value = Store.Value
type Value<T> = Store.Value<T>
type Keybind = Enum.KeyCode | "CTRL" | "SHIFT" | "ALT"
local sessionSyncedPreferences = {
isReducedMotion = true,
transparencyScale = true,
}
local store = {
selectedSurface = Value(Enum.SurfaceType.Studs),
applyT... | 1,056 |
cxmeel/resurface-plugin | cxmeel-resurface-plugin-334997a/src/init.client.luau | luau | .luau | local CoreGui = game:GetService("CoreGui")
local Janitor = require("@pkgs/Janitor")
local React = require("@pkgs/React")
local ReactRoblox = require("@pkgs/ReactRoblox")
local LocalStore = require("./Stores/LocalStore")
-- Migrations to ease transition from Surface Tool
if plugin:GetSetting("currentVersion") ~= nil ... | 478 |
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 |
arindam-codes/roblox-scripting-practices | arindam-codes-roblox-scripting-practices-8cbeb05/src/server/main.server.luau | luau | .luau | --[[
-- was understadning modulescripts
local module = require(game.ReplicatedStorage.Shared.moduleScript)
val = module.add(5, 3)
print(val)
]] | 37 |
arindam-codes/roblox-scripting-practices | arindam-codes-roblox-scripting-practices-8cbeb05/src/shared/moduleScript.luau | luau | .luau | --[[
local module = {}
-- do something
function module.add(a, b)
return a + b
end
return module
]] | 28 |
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 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/BrickColor.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local BrickColorType = {}
function BrickColorType:Serialize(value: BrickColor)
self:Write(8,"writef64",value.r * 255)
self:Write(8,"writef64", value.g * 255)
self:Write(8,"writef64", value.b * 255)
end
functio... | 150 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/CFrame.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local CFrameType = {}
function CFrameType:Serialize(value:CFrame)
local x,y,z,r01,r02,r03,r11,r12,r13,r21,r22,r23 = value:GetComponents()
self:Write(8,"writef64",x)
self:Write(8,"writef64",y)
self:Write(8,"... | 390 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Color3.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Color3Type = {}
function Color3Type:Serialize(value:Color3)
self:Write(8,"writef64",value.R * 255)
self:Write(8,"writef64", value.G * 255)
self:Write(8,"writef64", value.B * 255)
end
function Color3Type:... | 152 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/DateTime.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local DateTimeType = {}
function DateTimeType:Serialize(value:DateTime)
self:Write(8,"writef64",value.UnixTimestamp)
end
function DateTimeType:Deserialize()
return DateTime.fromUnixTimestamp(self:Read(8,"readf64")... | 85 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Float32.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Float32 = {}
function Float32:Serialize(value:number)
self:Write(4,"writef32",value)
end
function Float32:Deserialize()
return self:Read(4,"readf32")
end
return Float32 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Float64.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Float64 = {}
function Float64:Serialize(value:number)
self:Write(8,"writef64",value)
end
function Float64:Deserialize()
return self:Read(8,"readf64")
end
return Float64 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Integer16.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Integer16 = {}
function Integer16:Serialize(value:number)
self:Write(2,"writei16",value)
end
function Integer16:Deserialize()
return self:Read(2,"readi16")
end
return Integer16 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Integer32.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Integer32 = {}
function Integer32:Serialize(value:number)
self:Write(4,"writei32",value)
end
function Integer32:Deserialize()
return self:Read(4,"readi32")
end
return Integer32 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Integer8.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Integer8 = {}
function Integer8:Serialize(value:number)
self:Write(1,"writei8",value)
end
function Integer8:Deserialize()
return self:Read(1,"readi8")
end
return Integer8 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/TweenInfo.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local TweenInfoType = {}
function TweenInfoType:Serialize(value:TweenInfo)
self:Write(8,"writef64",value.Time)
self:Write(1,"writeu8",value.EasingStyle.Value)
self:Write(1,"writeu8",value.EasingDirection.Value)... | 259 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Udim.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local UdimType = {}
function UdimType:Serialize(value:UDim)
self:Write(8,"writef64",value.Scale)
self:Write(8,"writef64",value.Offset)
end
function UdimType:Deserialize()
return UDim.new(
self:Read(8,"readf64")... | 115 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Udim2.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Udim2Type = {}
function Udim2Type:Serialize(value:UDim2)
local x,y = value.X,value.Y
self:Write(8,"writef64",x.Scale)
self:Write(8,"writef64",x.Offset)
self:Write(8,"writef64",y.Scale)
self:Write(8,"writef64"... | 178 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Unsigned16.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Unsigned16 = {}
function Unsigned16:Serialize(value:number)
self:Write(2,"writeu16",value)
end
function Unsigned16:Deserialize()
return self:Read(2,"readu16")
end
return Unsigned16 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Unsigned32.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Unsigned32 = {}
function Unsigned32:Serialize(value:number)
self:Write(4,"writeu32",value)
end
function Unsigned32:Deserialize()
return self:Read(4,"readu32")
end
return Unsigned32 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Unsigned8.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Unsigned8 = {}
function Unsigned8:Serialize(value:number)
self:Write(1,"writeu8",value)
end
function Unsigned8:Deserialize()
return self:Read(1,"readu8")
end
return Unsigned8 | 77 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Vector2.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Vector2Type = {}
function Vector2Type:Serialize(value:Vector2)
self:Write(8,"writef64",value.X)
self:Write(8,"writef64",value.Y)
end
function Vector2Type:Deserialize()
return Vector2.new(
self:Read(8,"rea... | 115 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Vector2int16.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Vector2int16Type = {}
function Vector2int16Type:Serialize(value:Vector2int16)
self:Write(2,"writei16",value.X)
self:Write(2,"writei16",value.Y)
end
function Vector2int16Type:Deserialize()
return Vector2int1... | 127 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Vector3.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Vector3Type = {}
function Vector3Type:Serialize(value:Vector3)
self:Write(8,"writef64",value.X)
self:Write(8,"writef64",value.Y)
self:Write(8,"writef64",value.Z)
end
function Vector3Type:Deserialize()
retu... | 139 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Buffer/Types/Vector3int16.luau | luau | .luau | -- Madonox
-- 2024
-- Abstracts from Buffer (:Serialize is called as though it were the buffer)
local Vector3int16Type = {}
function Vector3int16Type:Serialize(value:Vector3int16)
self:Write(2,"writei16",value.X)
self:Write(2,"writei16",value.Y)
self:Write(2,"writei16",value.Z)
end
function Vector3int16Type:De... | 151 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Cleaner.luau | luau | .luau | -- Madonox
-- 2024
export type Cleaner = {
Cleanup: (any,string?) -> nil;
CleanupTable: ({[any]: any}) -> nil;
}
--[=[
@class Cleaner
The Cleaner class provides a set of functions for cleaning up instances, and tables.
]=]
local Cleaner:Cleaner = {} :: Cleaner
local CleanupFunctions = {
Instance = function(object... | 1,085 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Netty/init.luau | luau | .luau | --!native
--!optimize 2
-- Madonox
-- 2024
local RunService = game:GetService("RunService")
local NettyClient = require(script:WaitForChild("NettyClient"))
local NettyServer = require(script:WaitForChild("NettyServer"))
export type Netty = {
Client: NettyClient.NettyClient;
Server: NettyServer.NettyServer;
}
... | 141 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Observer.luau | luau | .luau | -- Madonox
-- 2024
export type Proxy = {
onRead: ((any) -> nil) -> nil;
onWrite: ((any,any) -> nil) -> nil;
__readEmitters: {(any) -> nil};
__writeEmitters: {(any,any) -> nil};
[any]: any;
}
export type Observer = {
new: () -> Proxy;
cleanup: (any) -> nil;
}
--[=[
@class Observer
The Observer class allows f... | 778 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/Thread.luau | luau | .luau | -- Madonox
-- 2024
--[=[
@interface ThreadOptions
@within Thread
.Interval number? -- The interval to run operations at (default 0.01).
.OperationLimit number? -- The number of operations to run each step (default 5).
]=]
export type ThreadOptions = {
Interval: number?;
OperationLimit: number?;
}
export type Thread... | 862 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/Commons/init.luau | luau | .luau | -- Madonox
-- 2024
local Buffer = require(script:WaitForChild("Buffer"))
local Netty = require(script:WaitForChild("Netty"))
local Thread = require(script:WaitForChild("Thread"))
local Observer = require(script:WaitForChild("Observer"))
type Commons = {
Netty: Netty.Netty;
Buffer: Buffer.BufferLibrary;
Threa... | 128 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/tests/client/net_test.client.luau | luau | .luau | -- Basic Roblox test
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("MyRemote")
local TotalCount = 0
Remote.OnClientEvent:Connect(function(count)
TotalCount += count
end)
task.spawn(function()
while task.wait(1) do
print(TotalCount)
end
end) | 70 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/tests/client/netty_client.client.luau | luau | .luau | local Commons = require(game:GetService("ReplicatedStorage"):WaitForChild("Commons"))
local NettyClient = Commons.Netty.Client
local TotalCount = 0
NettyClient.RegisterEvent("count number",function(number)
TotalCount += number
end)
local Count2 = 0
NettyClient.RegisterEvent("count number 2",function()
Count2 += 1
e... | 130 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/tests/server/net_test.server.luau | luau | .luau | -- Basic Roblox test
local Remote = Instance.new("RemoteEvent")
Remote.Name = "MyRemote"
Remote.Parent = game:GetService("ReplicatedStorage")
task.spawn(function()
while task.wait(1) do
for i = 1,200 do
Remote:FireAllClients(1)
end
end
end) | 72 |
Madonox/Commons | Madonox-Commons-67b4bc1/src/tests/server/netty_server.server.luau | luau | .luau | local Commons = require(game:GetService("ReplicatedStorage"):WaitForChild("Commons"))
local NettyServer = Commons.Netty.Server
NettyServer.RegisterEvent("count number")
NettyServer.RegisterEvent("count number 2")
NettyServer.Start()
task.spawn(function()
while task.wait(1) do
for i = 1,200 do
NettyServer.FireA... | 111 |
Breezy1214/EZ-Hitbox | Breezy1214-EZ-Hitbox-83291d0/src/Constants.luau | luau | .luau | --!strict
local Constants = {}
-- Default values
Constants.DEFAULT_VELOCITY_CONSTANT = 6
Constants.DEFAULT_DEBOUNCE_TIME = 0
Constants.DEFAULT_LIFETIME = 0
Constants.DEFAULT_DEBUG_MODE = false
Constants.DEFAULT_VELOCITY_PREDICTION = true
Constants.DEFAULT_LOOKING_FOR = "Humanoid" :: "Humanoid"
-- Spatial option types... | 221 |
Breezy1214/EZ-Hitbox | Breezy1214-EZ-Hitbox-83291d0/src/Types.luau | luau | .luau | --!strict
local Types = {}
-- Packages
local Janitor = require(script.Parent.Parent.Janitor)
-- Types
export type JanitorType = typeof(Janitor.new())
export type DotProductRequirement = {
DotProduct: number,
PartForVector: BasePart,
VectorType: ("LookVector" | "UpVector" | "RightVector")?,
Negative: boolean?,
}
... | 1,303 |
Breezy1214/EZ-Hitbox | Breezy1214-EZ-Hitbox-83291d0/src/init.luau | luau | .luau | --!strict
--[[
Quick Start:
local Hitbox = require(path.to.Hitbox)
-- Sphere hitbox (simplest)
local hit = Hitbox.sphere(10, character.HumanoidRootPart.CFrame)
hit.OnHit:Connect(function(characters) ... end)
hit:Start()
-- Box hitbox
local hit = Hitbox.box(Vector3.new(10, 5, 10), CFrame.new(0, 5, 0... | 5,971 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Attribute.lua | luau | .lua | -- v3 alone has taken 250+ hours so please consider keeping this
-- required attribute and linking to TopbarPlus within your games
-- description or devforum post. An in-game readable version also
-- makes it easier for me to debug and compare differences betewen
-- live places. Thanks! ~Ben
local RunService = game:Ge... | 130 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Elements/Caption.lua | luau | .lua | return function(icon)
-- Credit to lolmansReturn and Canary Software for
-- retrieving these values
local clickRegion = icon:getInstance("ClickRegion")
local caption = Instance.new("CanvasGroup")
caption.Name = "Caption"
caption.AnchorPoint = Vector2.new(0.5, 0)
caption.BackgroundTransparency = 1
capt... | 2,968 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Elements/Container.lua | luau | .lua | return function(Icon)
local GuiService = game:GetService("GuiService")
local isOldTopbar = Icon.isOldTopbar
local container = {}
local guiInset = GuiService:GetGuiInset()
local isConsoleScreen = GuiService:IsTenFootInterface()
local startInset = if isOldTopbar then 12 else guiInset.Y - (44 + 2)
if isConsoleScr... | 1,153 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Elements/Dropdown.lua | luau | .lua | return function(icon)
local dropdown = Instance.new("Frame")
dropdown.Name = "Dropdown"
dropdown.AutomaticSize = Enum.AutomaticSize.XY
dropdown.BackgroundTransparency = 1
dropdown.BorderSizePixel = 0
dropdown.AnchorPoint = Vector2.new(0.5, 0)
dropdown.Position = UDim2.new(0.5, 0, 1, 10)
dropdown.ZInd... | 1,590 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Elements/Menu.lua | luau | .lua | return function(icon)
local menu = Instance.new("ScrollingFrame")
menu.Name = "Menu"
menu.BackgroundTransparency = 1
menu.Visible = true
menu.ZIndex = 1
menu.Size = UDim2.fromScale(1, 1)
menu.ClipsDescendants = true
menu.TopImage = ""
menu.BottomImage = ""
menu.HorizontalScrollBarInset = Enum.ScrollBarInset.... | 1,614 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Elements/Notice.lua | luau | .lua | return function(icon, Icon)
local notice = Instance.new("Frame")
notice.Name = "Notice"
notice.ZIndex = 25
notice.AutomaticSize = Enum.AutomaticSize.X
notice.BorderColor3 = Color3.fromRGB(0, 0, 0)
notice.BorderSizePixel = 0
notice.BackgroundTransparency = 0.1
notice.BackgroundColor3 = Color3.fromRGB(255, 255, ... | 946 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Features/Overflow.lua | luau | .lua | -- When designing your game for many devices and screen sizes, icons may occasionally
-- particularly for smaller devices like phones, overlap with other icons or the bounds
-- of the screen. The overflow handler solves this challenge by moving the out-of-bounds
-- icon into an overflow menu (with a limited scrolling c... | 2,915 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Packages/GoodSignal.lua | luau | .lua | --------------------------------------------------------------------------------
-- Batched Yield-Safe Signal Implementation --
-- This is a Signal class which has effectively identical behavior to a --
-- normal RBXScriptSignal, with the only difference being a couple extra ... | 1,411 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/Reference.lua | luau | .lua | -- This module enables you to place Icon wherever you like within the data model while
-- still enabling third-party applications (such as HDAdmin/Nanoblox) to locate it
-- This is necessary to prevent two TopbarPlus applications initiating at runtime which would
-- cause icons to overlap with each other
local re... | 205 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/Icon/VERSION.lua | luau | .lua | return "v3.0.2" | 9 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/baseBox.luau | luau | .luau | local Config = require(script.Parent:WaitForChild("config"))
return function(scope, parent)
return scope:New("TextBox")({
TextScaled = true,
BackgroundColor3 = Config.SECONDARY_BACKGROUND_COLOUR,
TextColor3 = Color3.fromRGB(232, 232, 232),
AnchorPoint = Vector2.new(0.5, 0.5),
FontFace = Config.FONT,
Par... | 100 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/baseButton.luau | luau | .luau | local Fusion = require(script.Parent:WaitForChild("Fusion"))
local Config = require(script.Parent:WaitForChild("config"))
return function(scope, parent)
return scope:New("TextButton")({
TextScaled = true,
Size = UDim2.fromScale(0.38, 0.12),
BackgroundColor3 = Config.SECONDARY_BACKGROUND_COLOUR,
TextColor3 = C... | 162 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/baseLabel.luau | luau | .luau | local Config = require(script.Parent:WaitForChild("config"))
return function(scope, parent)
return scope:New("TextLabel")({
TextScaled = true,
BackgroundColor3 = Config.SECONDARY_BACKGROUND_COLOUR,
TextColor3 = Color3.fromRGB(232, 232, 232),
AnchorPoint = Vector2.new(0.5, 0.5),
FontFace = Config.FONT,
P... | 100 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/config.luau | luau | .luau | --!strict
local Config = {}
local Notation =
require(game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("chess"):WaitForChild("notation"))
Config.DEFAULT_AI_MOVE_TIME_IN_MILLISECONDS = 500
Config.LIGHT_SQUARE_COLOUR, Config.DARK_SQUARE_COLOUR = Color3.fromRGB(234, 233, 210), Color3.fromRGB(75... | 555 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/aiMoveTimeBox.luau | luau | .luau | local Fusion = require(script.Parent.Parent:WaitForChild("Fusion"))
local baseLabel = require(script.Parent.Parent:WaitForChild("baseLabel"))
local baseBox = require(script.Parent.Parent:WaitForChild("baseBox"))
return function(scope, parent)
local aiMoveTimeBox = scope:Hydrate(baseBox(scope, parent))({
Name = "AIM... | 233 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/aiSelfPlayButton.luau | luau | .luau | --!strict
local baseButton = require(script.Parent.Parent:WaitForChild("baseButton"))
return function(scope, parent)
return scope:Hydrate(baseButton(scope, parent))({
Name = "AISelfPlayButton",
Position = UDim2.fromScale(0.25, 0.71),
Text = "AI vs AI",
})
end
| 80 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/fenBox.luau | luau | .luau | local Fusion = require(script.Parent.Parent:WaitForChild("Fusion"))
local baseBox = require(script.Parent.Parent:WaitForChild("baseBox"))
return function(scope, parent)
return scope:Hydrate(baseBox(scope, parent))({
Name = "FEN",
Size = UDim2.fromScale(0.9, 0.1),
ClearTextOnFocus = false,
ZIndex = 2,
Positi... | 140 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/init.luau | luau | .luau | --!strict
local Fusion = require(script.Parent:WaitForChild("Fusion"))
local Config = require(script.Parent:WaitForChild("config"))
return function(scope, parent)
local frame = scope:New("Frame")({
AnchorPoint = Vector2.new(1, 0.5),
Position = UDim2.fromScale(1, 0.5),
Size = UDim2.fromScale(0.2, 1),
Backgrou... | 212 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/movesFrame.luau | luau | .luau | local Fusion = require(script.Parent.Parent:WaitForChild("Fusion"))
local baseLabel = require(script.Parent.Parent:WaitForChild("baseLabel"))
local Config = require(script.Parent.Parent:WaitForChild("config"))
return function(scope, parent, moves)
return scope:New("ScrollingFrame")({
Name = "Moves",
Size = UDim2.... | 337 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/openingLabel.luau | luau | .luau | local Fusion = require(script.Parent.Parent:WaitForChild("Fusion"))
local baseLabel = require(script.Parent.Parent:WaitForChild("baseLabel"))
return function(scope, parent)
return scope:Hydrate(baseLabel(scope, parent))({
Name = "Opening",
Size = UDim2.fromScale(0.9, 0.08),
ZIndex = 2,
Position = UDim2.fromSc... | 130 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/rotateButton.luau | luau | .luau | --!strict
local baseButton = require(script.Parent.Parent:WaitForChild("baseButton"))
return function(scope, parent)
return scope:Hydrate(baseButton(scope, parent))({
Text = "Rotate",
Position = UDim2.fromScale(0.75, 0.87),
})
end
| 68 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/sideBar.story.luau | luau | .luau | --!strict
local Fusion = require(script.Parent.Parent:WaitForChild("Fusion"))
local makeSideBar = require(script.Parent)
local makeUndoButton = require(script.Parent:WaitForChild("undoButton"))
local makeRotateButton = require(script.Parent:WaitForChild("rotateButton"))
local makeAIMoveTimeBox = require(script.Parent:... | 302 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/sideBar/undoButton.luau | luau | .luau | --!strict
local baseButton = require(script.Parent.Parent:WaitForChild("baseButton"))
return function(scope, parent)
return scope:Hydrate(baseButton(scope, parent))({
Position = UDim2.fromScale(0.25, 0.87),
Name = "Undo",
Text = "Undo",
})
end
| 74 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/uciConsole/frame.luau | luau | .luau | --!strict
local Fusion = require(script.Parent.Parent:WaitForChild("Fusion"))
local Config = require(script.Parent.Parent:WaitForChild("config"))
local baseBox = require(script.Parent.Parent:WaitForChild("baseBox"))
local baseLabel = require(script.Parent.Parent:WaitForChild("baseLabel"))
local baseButton = require(sc... | 866 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/uciConsole/init.luau | luau | .luau | local TextService = game:GetService("TextService")
local RunService = game:GetService("RunService")
local makeUCIConsole = require(script:WaitForChild("frame"))
local baseBox = require(script.Parent:WaitForChild("baseBox"))
local Config = require(script.Parent:WaitForChild("config"))
local Fusion = require(script.Pare... | 901 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/client/uciConsole/uciConsole.story.luau | luau | .luau | --!strict
local Fusion = require(script.Parent.Parent:WaitForChild("Fusion"))
local makeUCIConsole = require(script.Parent)
return function(parent)
local scope = Fusion.scoped({
New = Fusion.New,
Hydrate = Fusion.Hydrate,
Value = Fusion.Value,
Computed = Fusion.Computed,
Observer = Fusion.Observer,
})
l... | 119 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/shared/chess/board.luau | luau | .luau | --!strict
local Board = {}
local Notation = require(script.Parent:WaitForChild("notation"))
-- Only used because the type checker is wrong
local unneeded_assert = assert
type boardState = {
board: buffer,
whiteToPlay: boolean,
whiteCanCastleKingSide: boolean,
whiteCanCastleQueenSide: boolean,
blackCanCastleK... | 2,291 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/shared/chess/engine/init.luau | luau | .luau | --!strict
local WASM = require(script:WaitForChild("wasm"))
local Engine = {}
local Signal = require(script:WaitForChild("LemonSignal"))
local inputSignal = Signal.new()
local outputSignal = Signal.new()
local function setListener(listener)
if listener then
WASM.setListener(function(output)
outputSignal:Fire(... | 622 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/shared/chess/engine/wasm/init.luau | luau | .luau | --!strict
local WASM = {}
local messageListener: (string) -> ...any? = print
local rust
rust = require(script:WaitForChild("compiled"))({
env = {
time = { os.clock },
print_string = {
function(_, pointer, length)
messageListener(buffer.readstring(rust.memory[1], pointer, length))
end,
},
},
})
fun... | 172 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/shared/chess/notation.luau | luau | .luau | --!strict
local Notation = {}
Notation.FILE_NUMBER_TO_NAME = buffer.fromstring("abcdefgh")
Notation.SQUARE_NUMBER_TO_NAME = table.create(63)
Notation.SQUARE_NAME_TO_NUMBER = {}
for x = 0, 7 do
for y = 0, 7 do
local name = buffer.readstring(Notation.FILE_NUMBER_TO_NAME, x, 1) .. y + 1
Notation.SQUARE_NUMBER_TO_N... | 669 |
Someon1e/chess_spider | Someon1e-chess_spider-5ead430/src/shared/chess/openings/init.luau | luau | .luau | local data = require(script:WaitForChild("data"))
local openings = {}
function openings.getFromMoves(moves)
return data[moves]
end
return table.freeze(openings)
| 37 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/PluginComponents/Toolbar.luau | luau | .luau | local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local Hydrate = Fusion.Hydrate
local COMPONENT_ONLY_PROPERTIES = {
"Name",
}
type ToolbarProperties = {
Name: string,
[any]: any,
}
return function(props: ToolbarProperties): PluginToolbar
loc... | 135 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/PluginComponents/ToolbarButton.luau | luau | .luau | local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local PluginComponents = script.Parent
local StudioComponents = PluginComponents.Parent:FindFirstChild("StudioComponents")
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local ... | 310 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/PluginComponents/Widget.luau | luau | .luau | local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local Hydrate = Fusion.Hydrate
local COMPONENT_ONLY_PROPERTIES = {
"Id",
"InitialDockTo",
"InitialEnabled",
"ForceInitialEnabled",
"FloatingSize",
"MinimumSize",
"Plugin"
}
type PluginGuiPro... | 314 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/Background.luau | luau | .luau | local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local themeProvider = require(StudioComponentsUtil.themeProvider)
local stripProps = requi... | 307 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/BaseButton.luau | luau | .luau | -- Roact version by @sircfenner
-- Ported to Fusion by @YasuYoshida
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local BoxBorder = req... | 818 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/BaseScrollFrame/ScrollArrow.luau | luau | .luau | -- Roact version by @sircfenner
-- Ported to Fusion by @YasuYoshida
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local themePro... | 1,261 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/BaseScrollFrame/ScrollBar.luau | luau | .luau | -- Writen by @boatbomber
-- Modified by @mvyasu
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local ScrollArrow = require(script... | 1,999 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/BaseScrollFrame/init.luau | luau | .luau | -- Written by @boatbomber
-- Modified by @mvyasu
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local Background = require(StudioCompone... | 1,208 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/BoxBorder.luau | luau | .luau | local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local themeProvider = require(StudioComponentsUtil.themeProvider)
local constants = requir... | 487 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/Button.luau | luau | .luau | -- Roact version by @sircfenner
-- Ported to Fusion by @YasuYoshida
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local BaseButton = re... | 158 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/Checkbox.luau | luau | .luau | -- Roact version by @sircfenner
-- Ported to Fusion by @YasuYoshida
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local BoxBorder = req... | 1,495 |
Ultrasonic1209/Zappy | Ultrasonic1209-Zappy-2577109/src/Components/StudioComponents/ClassIcon.luau | luau | .luau | -- Written by @boatbomber
local StudioService = game:GetService("StudioService")
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Fusion = require(Plugin:FindFirstChild("Fusion", true))
local StudioComponents = script.Parent
local StudioComponentsUtil = StudioComponents:FindFirstChild("Util")
local st... | 324 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.