Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
876
56.4k
input
stringlengths
36
20k
code
stringlengths
270
52.3k
readme
stringlengths
0
21.9k
I need a server Script (in ServerScriptService) for a racing league game that manages kill bricks and environmental hazards. The script should handle different hazard types like spike strips, fire walls, and laser barriers, each with their own damage and cooldown. It needs a per-player debounce so hazards don't spam da...
I need a server Script (in ServerScriptService) for a racing league game that manages kill bricks and environmental hazards. The script should handle different hazard types like spike strips, fire walls, and laser barriers, each with their own damage and cooldown. It needs a per-player debounce so hazards don't spam da...
--!strict -- ServerScriptService/RacingHazardController.server.luau -- Manages environmental hazards for the racing league: spike strips, fire walls, laser barriers. -- Handles streaming-in parts, per-player debounce, and spatial proximity warnings. const ReplicatedStorage = game:GetService("ReplicatedStorage") const ...
This Script implements a racing league hazard system with three hazard kinds (SpikeStrip, FireWall, LaserBarrier) loaded from a config ModuleScript. It uses `const` for all bindings that are never reassigned (services, config, state tables, constants). The `OverlapParams` proximity check uses `IncludeInstances` with th...
Write a ServerScriptService Script that simulates airship cannon projectiles with gravity and continuous collision detection. The module must expose a single `fire(origin: Vector3, direction: Vector3, owner: Model)` function. Projectiles travel at a configurable muzzle velocity, fall under a configurable gravity consta...
Write a ServerScriptService Script that simulates airship cannon projectiles with gravity and continuous collision detection. The module must expose a single `fire(origin: Vector3, direction: Vector3, owner: Model)` function. Projectiles travel at a configurable muzzle velocity, fall under a configurable gravity consta...
--!strict -- ServerScriptService/AirshipCannonProjectile.server.luau -- Swept-collision projectile for airship fleet combat. const Workspace = game:GetService("Workspace") const Debris = game:GetService("Debris") const RunService = game:GetService("RunService") -- Tuning constants ------------------------------------...
The script implements a swept-collision cannon projectile for airship combat: each frame it raycasts from the previous position to the new position so fast shells never tunnel through hulls. All tuning values are `const` at the top; every binding that is never reassigned uses `const` (services, config, caches, locals)....
We need a server Script in ServerScriptService that manages a battle-royale style checkpoint system for an obstacle course. Players progress through numbered "Extraction Points" scattered across the map; touching one records it as their latest safe zone. When a player dies, they respawn at their most recently reached E...
We need a server Script in ServerScriptService that manages a battle-royale style checkpoint system for an obstacle course. Players progress through numbered "Extraction Points" scattered across the map; touching one records it as their latest safe zone. When a player dies, they respawn at their most recently reached E...
--!strict const Players = game:GetService("Players") const Workspace = game:GetService("Workspace") const ReplicatedStorage = game:GetService("ReplicatedStorage") const Debris = game:GetService("Debris") const CHECKPOINT_FOLDER_NAME = "ExtractionPoints" const RESPAWN_DELAY_SECONDS = 3 const MAX_CHECKPOINTS = 25 const ...
This server Script implements a battle-royale checkpoint system where players advance through "ExtractionPoint_N" parts in a Workspace folder. It uses `const` for all services, configuration constants, and immutable tables; player progress is stored in a `playerData` map keyed by Player so it survives character respawn...
Write a LocalScript for StarterPlayerScripts that finds nearby "Collectable" tagged parts using OverlapParams with ExcludeInstances to ignore the player character, then fires a RemoteEvent when collected. ```luau --!strict const CollectionService = game:GetService("CollectionService") const ReplicatedStorage = game:Ge...
Write a LocalScript for StarterPlayerScripts that finds nearby "Collectable" tagged parts using OverlapParams with ExcludeInstances to ignore the player character, then fires a RemoteEvent when collected.
--!strict const CollectionService = game:GetService("CollectionService") const ReplicatedStorage = game:GetService("ReplicatedStorage") const Players = game:GetService("Players") const Workspace = game:GetService("Workspace") const RunService = game:GetService("RunService") const COLLECTABLE_TAG = "Collectable" const ...
This LocalScript runs in StarterPlayerScripts and uses OverlapParams with ExcludeInstances to ignore the player's own character while detecting nearby collectables tagged with "Collectable". It throttles overlap checks and collection events with configurable constants at the top, and fires a RemoteEvent to the server w...
Create a ServerScriptService Script that lets players open the in-game shop via a wasteland trader NPC prompt and a HUD button, cleaning up per-player connections on leave. ```luau --!strict const Players = game:GetService("Players") const MarketplaceService = game:GetService("MarketplaceService") const ReplicatedStor...
Create a ServerScriptService Script that lets players open the in-game shop via a wasteland trader NPC prompt and a HUD button, cleaning up per-player connections on leave.
--!strict const Players = game:GetService("Players") const MarketplaceService = game:GetService("MarketplaceService") const ReplicatedStorage = game:GetService("ReplicatedStorage") const Workspace = game:GetService("Workspace") const SHOP_OPEN_REMOTE = "WastelandShopOpen" const PROMPT_ACTION_TEXT = "Trade" const PROMP...
The script creates a ProximityPrompt on a wasteland trader NPC and a RemoteEvent for a HUD button; both call MarketplaceService:OpenShop for the requesting player. Per-player connections are stored in a module-level table and disconnected on PlayerRemoving to prevent leaks. const binds all services, config values, and ...
Write a server Script (in ServerScriptService) that handles ProcessReceipt for our ninja dojo's developer products. Products: 1248910 "Shuriken Pack" (grants 50 shurikens), 1248911 "Dojo Membership" (grants 30-day VIP), 1248912 "Training Scroll" (grants 1 XP boost). Requirements: validate receipt Info.ProductId against...
Write a server Script (in ServerScriptService) that handles ProcessReceipt for our ninja dojo's developer products. Products: 1248910 "Shuriken Pack" (grants 50 shurikens), 1248911 "Dojo Membership" (grants 30-day VIP), 1248912 "Training Scroll" (grants 1 XP boost). Requirements: validate receipt Info.ProductId against...
--!strict const MarketplaceService = game:GetService("MarketplaceService") const DataStoreService = game:GetService("DataStoreService") const Players = game:GetService("Players") type ReceiptInfo = { ProductId: number, PlayerId: number, PurchaseId: string, CurrencySpent: number, CurrencyType: Enum.CurrencyType, ...
This ProcessReceipt handler validates product IDs against a typed catalog, awards rewards via DataStore with retry/backoff, and queues purchases for offline players in a separate pending store. It uses `const` for all immutable bindings (services, config, catalog, intermediate results) and `if const record = loadRecord...
Create a server Script in ServerScriptService that implements a reusable projectile system for a horror mansion game. The system must simulate gravity-affected projectiles (like thrown candles or spectral orbs) and perform continuous collision detection between physics steps so fast-moving projectiles never tunnel thro...
Create a server Script in ServerScriptService that implements a reusable projectile system for a horror mansion game. The system must simulate gravity-affected projectiles (like thrown candles or spectral orbs) and perform continuous collision detection between physics steps so fast-moving projectiles never tunnel thro...
--!strict -- ProjectileSystem.server.lua -- ServerScriptService/ProjectileSystem.server.lua -- Horror mansion projectile arc with continuous collision detection. -- Designed for unit testing: pure trajectory math is separated from WorldRoot calls. const RunService = game:GetService("RunService") const Workspace = game...
The script implements a gravity-affected projectile system with continuous collision detection using fixed-step raycasts between frames. It uses `const` for all bindings that are never reassigned (services, config tables, callbacks, and the public API function) and modern `RaycastParams` with `ExcludeInstances`/`Includ...
Refactor this ModuleScript (ReplicatedStorage/CharacterUtils) to modern Luau with const everywhere and no per-frame allocations. ```lua local Players = game:GetService("Players") local RunService = game:GetService("RunService") local MAX_MANA = 100 local MANA_REGEN_RATE = 5 local COOLDOWN_TIME = 1.5 local characterCa...
Refactor this ModuleScript (ReplicatedStorage/CharacterUtils) to modern Luau with const everywhere and no per-frame allocations. ```lua local Players = game:GetService("Players") local RunService = game:GetService("RunService") local MAX_MANA = 100 local MANA_REGEN_RATE = 5 local COOLDOWN_TIME = 1.5 local characterCa...
--!strict -- ReplicatedStorage/CharacterUtils -- Safe character/humanoid/rootPart access + mana helpers for a school of magic. -- Zero per-frame allocations in the hot path (regenMana). const Players = game:GetService("Players") const RunService = game:GetService("RunService") const MAX_MANA = 100 const MANA_REGEN_RA...
The module caches character, humanoid, and root part lookups per player and invalidates on PlayerRemoving. Every binding that never changes is `const`; nil checks use `if local` to narrow types and avoid repeated indexing. The hot-path `regenMana` allocates no tables and reuses the cached humanoid reference. Added expl...
I have a ProcessReceipt handler in a Script under ServerScriptService for my cyberpunk alley game. It handles developer product purchases for "Neon Credits" packs. The current code works but uses old patterns: wait(), local for constants, nested if/then for nil checks, and no exploit protection. Please modernize it wit...
I have a ProcessReceipt handler in a Script under ServerScriptService for my cyberpunk alley game. It handles developer product purchases for "Neon Credits" packs. The current code works but uses old patterns: wait(), local for constants, nested if/then for nil checks, and no exploit protection. Please modernize it wit...
--!strict const MarketplaceService = game:GetService("MarketplaceService") const DataStoreService = game:GetService("DataStoreService") const Players = game:GetService("Players") const PRODUCT_SMALL = 1847291 const PRODUCT_MEDIUM = 1847292 const PRODUCT_LARGE = 1847293 const CREDIT_AMOUNTS: { [number]: number } = tab...
The modernized ProcessReceipt handler uses `const` for all services, product IDs, credit amounts, and DataStore configuration. It validates product IDs against an allow-list to prevent exploiters from injecting arbitrary IDs, checks receipt deduplication via DataStore with exponential backoff retries, and uses `if cons...
Create a ModuleScript at ReplicatedStorage/Shared/RacingRateLimiter that implements a per-player rate limiter for remote events in a racing league. The limiter must use a sliding time window, support per-call config overrides, and clean up stale player entries automatically. All bindings that are never reassigned must ...
Create a ModuleScript at ReplicatedStorage/Shared/RacingRateLimiter that implements a per-player rate limiter for remote events in a racing league. The limiter must use a sliding time window, support per-call config overrides, and clean up stale player entries automatically. All bindings that are never reassigned must ...
--!strict const Players = game:GetService("Players") const RunService = game:GetService("RunService") export type RateLimitConfig = { maxCalls: number, windowSeconds: number, } export type PlayerRateLimit = { config: RateLimitConfig, calls: { number }, lastCleanup: number, } const RacingRateLimiter = {} RacingR...
This ModuleScript provides a per-player sliding-window rate limiter for racing remotes. Every non-reassigned binding uses `const` (services, configs, loop variables, intermediate results). The `check` method guards against nil or already-removed players, which covers streaming-in edge cases. Stale entries are purged vi...
I need a LocalScript that goes in StarterPlayerScripts to show floating damage numbers above enemies when they take damage. It should work for both keyboard/mouse and gamepad players. The server will fire a RemoteEvent with the position and damage amount, and I want the numbers to float up and fade out. Also add a way ...
I need a LocalScript that goes in StarterPlayerScripts to show floating damage numbers above enemies when they take damage. It should work for both keyboard/mouse and gamepad players. The server will fire a RemoteEvent with the position and damage amount, and I want the numbers to float up and fade out. Also add a way ...
--!strict const ReplicatedStorage = game:GetService("ReplicatedStorage") const RunService = game:GetService("RunService") const UserInputService = game:GetService("UserInputService") const Players = game:GetService("Players") const Workspace = game:GetService("Workspace") const DAMAGE_EVENT_NAME = "DamageNumberEvent" ...
This LocalScript creates a floating damage number system that listens for a RemoteEvent from the server, converts world positions to screen space, and animates text labels upward while fading them out. It uses `const` for all services, configuration values, and bindings that are never reassigned. The Input Action Syste...
This is a ModuleScript that lives in ReplicatedStorage.HauntedCarnival.PlayerData. It manages a per-player "SpookyCoins" value backed by a DataStore. The legacy version below uses wait(), UPPER_CASE locals, nested ifs, and bare GetAsync/SetAsync calls. Please rewrite it with modern Luau: strict mode, const bindings, if...
This is a ModuleScript that lives in ReplicatedStorage.HauntedCarnival.PlayerData. It manages a per-player "SpookyCoins" value backed by a DataStore. The legacy version below uses wait(), UPPER_CASE locals, nested ifs, and bare GetAsync/SetAsync calls. Please rewrite it with modern Luau: strict mode, const bindings, if...
--!strict -- ReplicatedStorage.HauntedCarnival.PlayerData -- Manages per-player SpookyCoins with DataStore persistence. const DataStoreService = game:GetService("DataStoreService") const Players = game:GetService("Players") const DATASTORE_NAME = "HauntedCarnival_Coins_v1" const MAX_ATTEMPTS = 4 const BASE_DELAY = 1 ...
The module uses const for all services, config, and tables that are never rebound. DataStore calls are wrapped in pcall with capped exponential backoff (MAX_ATTEMPTS = 4). An if-local binding in loadCoins narrows the optional result to a non-nil number, and an if-local expression in GetCoins returns the coin count or 0...
I need a LocalScript for StarterPlayerScripts that implements a wild west themed dodge roll ability. Requirements: 1) Cooldown of about 1.5 seconds with a warning when the player tries to dodge too soon. 2) Works with keyboard (LeftShift), gamepad (left stick click), and an on-screen touch button. 3) Dashes in the curr...
I need a LocalScript for StarterPlayerScripts that implements a wild west themed dodge roll ability. Requirements: 1) Cooldown of about 1.5 seconds with a warning when the player tries to dodge too soon. 2) Works with keyboard (LeftShift), gamepad (left stick click), and an on-screen touch button. 3) Dashes in the curr...
--!strict const Players = game:GetService("Players") const UserInputService = game:GetService("UserInputService") const ReplicatedStorage = game:GetService("ReplicatedStorage") const Workspace = game:GetService("Workspace") const Debris = game:GetService("Debris") const DASH_COOLDOWN = 1.5 const DASH_FORCE = 85 const ...
This LocalScript lives in StarterPlayerScripts and implements a wild west dodge roll using the Input Action System with keyboard (LeftShift), gamepad (ButtonL3), and a styled touch button. It uses `const` for all never-reassigned bindings (services, config, IAS objects, UI) and `if const` to safely fetch fresh characte...
Create a server Script for ServerScriptService that implements a haunted carnival teleport portal. The portal should detect when a player touches a specific trigger part (named "PortalTrigger" inside a "HauntedPortal" model in Workspace) and teleport them to a destination part (named "PortalExit" in the same model). Th...
Create a server Script for ServerScriptService that implements a haunted carnival teleport portal. The portal should detect when a player touches a specific trigger part (named "PortalTrigger" inside a "HauntedPortal" model in Workspace) and teleport them to a destination part (named "PortalExit" in the same model). Th...
--!strict const Workspace = game:GetService("Workspace") const Players = game:GetService("Players") const PORTAL_MODEL_NAME = "HauntedPortal" const TRIGGER_NAME = "PortalTrigger" const EXIT_NAME = "PortalExit" const MAX_TELEPORT_SPEED = 50 const DEBOUNCE_SECONDS = 1.5 const STREAM_TIMEOUT = 10 const PORTAL_RADIUS = 6 ...
This server Script implements a haunted carnival portal that teleports players from a trigger part to an exit part while preserving momentum direction (clamped to max speed). It uses `const` for all stable bindings, `if const` to narrow `character` and `player` in the `Touched` handler, and `OverlapParams` with `Exclud...
Create a ModuleScript at ReplicatedStorage.CandyMaid that manages connection and instance cleanup for a candy land game, automatically disposing everything when a player leaves. ```luau --!strict export type MaidTask = () -> () export type MaidEntry = MaidTask | RBXScriptConnection | Instance | { [any]: MaidEntry } c...
Create a ModuleScript at ReplicatedStorage.CandyMaid that manages connection and instance cleanup for a candy land game, automatically disposing everything when a player leaves.
--!strict export type MaidTask = () -> () export type MaidEntry = MaidTask | RBXScriptConnection | Instance | { [any]: MaidEntry } const RunService = game:GetService("RunService") const Players = game:GetService("Players") const DEFAULT_CLEANUP_DELAY = 0.1 const Maid = {} Maid.__index = Maid export type Maid = typeo...
This ModuleScript provides a Maid class for automatic cleanup of connections, instances, promises, and custom tasks. It uses `const` for all services, configuration constants, and internal bindings that are never reassigned. The `linkToPlayer` and `linkToCharacter` methods automatically trigger cleanup when the player ...
Create a LocalScript for StarterPlayerScripts that displays floating damage numbers above enemies in our ninja dojo game. The numbers should appear at the hit position, animate upward while fading out, and automatically clean up after a short duration. Include a config table at the top with tunable values for font size...
Create a LocalScript for StarterPlayerScripts that displays floating damage numbers above enemies in our ninja dojo game. The numbers should appear at the hit position, animate upward while fading out, and automatically clean up after a short duration. Include a config table at the top with tunable values for font size...
--!strict const ReplicatedStorage = game:GetService("ReplicatedStorage") const TweenService = game:GetService("TweenService") const Debris = game:GetService("Debris") const CONFIG = { FONT_SIZE = 36, ANIMATION_DURATION = 0.8, RISE_DISTANCE = 6, NORMAL_COLOR = Color3.fromRGB(255, 230, 120), CRITICAL_COLOR = Color3...
This LocalScript listens for a server-fired RemoteEvent and spawns animated BillboardGui damage numbers at the given world position. It uses `const` for all services, configuration, and the remote reference, and an `if local` binding to cleanly handle the optional `isCritical` boolean. The CONFIG table at the top expos...
Hey! I have this checkpoint script for my dinosaur park obby that's in ServerScriptService. It works but it's kinda messy and uses old stuff like wait() and a bunch of nested ifs. Can you clean it up to use the new Luau features? Also I want designers to be able to tweak checkpoint settings like respawn delay and max c...
Hey! I have this checkpoint script for my dinosaur park obby that's in ServerScriptService. It works but it's kinda messy and uses old stuff like wait() and a bunch of nested ifs. Can you clean it up to use the new Luau features? Also I want designers to be able to tweak checkpoint settings like respawn delay and max c...
--!strict const Players = game:GetService("Players") const Workspace = game:GetService("Workspace") const ReplicatedStorage = game:GetService("ReplicatedStorage") const checkpointFolder = Workspace:WaitForChild("DinoCheckpoints") const remoteEvent = ReplicatedStorage:WaitForChild("CheckpointRemote") :: RemoteEvent ty...
The script manages dinosaur-themed obstacle course checkpoints with respawning. It uses `const` for all stable bindings (services, folders, remotes, loop variables) and `if local` to collapse nested nil checks when fetching the player, character, humanoid root part, and checkpoint parts. Designers tune `RespawnDelay` a...
End of preview. Expand in Data Studio

Luaudev2 Roblox Luau 2026 dataset

This dataset is a github-like formatted varaint of the luaudev2 dataset, all rows were saved here, all code has been verified with luau lsp, luau analyze and formatted with stylelua.

All data under openmdw1.1, this dataset is a part of the luaudev2 model release.

NOTES:

  • all data is synthetic (mostly generated with kimi k3)
  • all code is verified and does not error
  • api/syntax cutoff date is october 11th, 2026
Downloads last month
78

Models trained or fine-tuned on Pinkstack/oct2026-Roblox-Luaudev2-dataset-pretrain