Filters

Category

Complexity

Script Templates

15 / 15
Combat
Beginner

Kill Brick (Debounced)

Touch-triggered kill brick with proper debounce, server-side damage, and configurable kill vs damage modes.

-- KillBrick.lua — place inside the brick Part
local Players = game:GetService("Players")
local brick = script.Parent
local DAMAGE = 100
local DEBOUNCE = 0.5
local lastHit: {[Model]: number} = {}
...
Script
42L
Players
DataStore
Intermediate

DataStore Save/Load

Basic DataStore v2 save/load with pcall error handling and default value fallback for new players.

-- DataManager.lua — ServerScriptService
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local store = DataStoreService:GetDataStore("PlayerData_v1")
 
local function loadData(player)
...
Script
58L
DataStoreServicePlayers
Networking
Intermediate

RemoteEvent — Secure Handler

Server-side RemoteEvent handler with input validation, rate limiting, and type checking. Anti-exploit baseline.

-- RemoteHandler.lua — ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local event = ReplicatedStorage:WaitForChild("GameEvent")
local calls: {[number]: number} = {}
local LIMIT, WINDOW = 15, 1
...
Script
67L
PlayersReplicatedStorage
Animation
Beginner

Tween Animation — Part

Smooth part animation using TweenService. Configurable loop, reverse, and easing styles. No deprecated lerp patterns.

-- TweenPart.lua — inside the Part
local TweenService = game:GetService("TweenService")
local part = script.Parent
local START = part.Position
local END = START + Vector3.new(0, 10, 0)
 
...
Script
32L
TweenService
AI & Pathfinding
Advanced

NPC Pathfinding — Chase

PathfindingService NPC that chases the nearest player with configurable range, update rate, and cost map for terrain avoidance.

-- NPCChase.lua — inside NPC Model
local PathfindingService = game:GetService("PathfindingService")
local Players = game:GetService("Players")
local npc = script.Parent
local hum = npc:WaitForChild("Humanoid")
local root = npc:WaitForChild("HumanoidRootPart")
...
Script
78L
PathfindingServicePlayersRunService
Economy
Advanced

Currency System — Full Module

Complete server-authoritative currency module with DataStore persistence, leaderboard stats, and anti-exploit guards.

-- CurrencyService.lua — ReplicatedStorage/Modules
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local store = DataStoreService:GetDataStore("Currency_v2")
local cache: {[number]: {coins: number}} = {}
local CurrencyService = {}
...
ModuleScript
112L
DataStoreServicePlayersRunService
Animation
Intermediate

Character Animation Controller

LocalScript animation state machine for custom character animations. Uses Animator:LoadAnimation() — not deprecated Humanoid method.

-- AnimController.lua — StarterCharacterScripts
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
...
LocalScript
65L
PlayersRunServiceUserInputService
Combat
Beginner

Tool — Click to Damage

Player tool with mouse click damage, cooldown, and server-side validation. Uses ToolActivated instead of deprecated mouse events.

-- ToolClient.lua — LocalScript inside Tool
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local tool = script.Parent
local player = Players.LocalPlayer
local COOLDOWN = 0.8
...
LocalScript
44L
PlayersReplicatedStorage
Interaction
Beginner

Proximity Prompt — Interaction

ProximityPrompt-based interaction system with server validation. Cleaner than Touched for interactable objects.

-- InteractScript.lua — inside the Part
local Players = game:GetService("Players")
local part = script.Parent
 
local prompt = Instance.new("ProximityPrompt")
prompt.ActionText = "Interact"
...
Script
30L
Players
UI & Stats
Beginner

Leaderstats — Multi-Stat

Server-side leaderstats folder with multiple stat types (IntValue, StringValue). Initializes on PlayerAdded.

-- Leaderstats.lua — ServerScriptService
local Players = game:GetService("Players")
 
Players.PlayerAdded:Connect(function(player)
local ls = Instance.new("Folder")
ls.Name = "leaderstats"
...
Script
28L
Players
Game Systems
Intermediate

Round System — Timer

Game round manager with lobby, active, and intermission states. Uses task.wait() not deprecated wait().

-- RoundManager.lua — ServerScriptService
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local statusValue = ReplicatedStorage:WaitForChild("GameStatus")
 
local LOBBY_TIME = 30
...
Script
72L
PlayersReplicatedStorage
Audio
Beginner

Sound Manager — Module

Centralized sound manager ModuleScript for playing, stopping, and managing sound effects and music with volume control.

-- SoundManager.lua — ReplicatedStorage/Modules
local SoundService = game:GetService("SoundService")
local SoundManager = {}
local sounds: {[string]: Sound} = {}
 
function SoundManager:Register(name: string, id: string, parent: Instance?)
...
ModuleScript
45L
SoundService
VFX
Beginner

Beam Effect — VFX

Dynamic Beam between two parts with configurable width, color, and animation. For laser, lightning, or connection effects.

-- BeamEffect.lua — inside Part
local TweenService = game:GetService("TweenService")
local part = script.Parent
local target = workspace:WaitForChild("TargetPart")
 
local a0 = Instance.new("Attachment", part)
...
Script
38L
TweenService
Teleportation
Intermediate

Teleport Pad — Cross-Place

TeleportService pad that teleports players to another place or reserved server. With loading screen trigger and party support.

-- TeleportPad.lua — inside the pad Part
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local pad = script.Parent
local TARGET_PLACE_ID = 0000000 -- Replace with your place ID
local debounce = {}
...
Script
40L
TeleportServicePlayers
Game Systems
Advanced

Spectator System

Camera spectator mode for dead players. Cycles through alive players with keyboard input. Client-side only.

-- SpectatorController.lua — StarterCharacterScripts
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
...
LocalScript
68L
PlayersUserInputServiceRunService