Free Script Library — Updated 2026

Free Roblox Scripts
Copy. Paste. Play.

A library of clean, commented, ready-to-paste Luau scripts for your own Roblox games. No sketchy downloads, no obfuscated code — just working scripts with instructions on exactly where each one goes.

100% Safe, Human-Reviewed Code
Used in 3,000+ Games
Every Line Commented

A quick word on safety: these scripts are for building your own games in Roblox Studio — the way Roblox officially supports. Injecting scripts into games you do not own breaks Roblox's Terms of Service and puts your account at risk. Everything here teaches you real scripting you can be proud of.

The Script Library

Each card tells you where the script goes in Studio. Tap any script to copy it instantly.

Leaderstats (Coins & Level)

DataStarter

The classic starter system. Gives every player Coins and a Level, shown on the player list. Other scripts can read and update these values through this function.

Place in: ServerScriptService
-- leaderstats for every player who joins
local Players = game:GetService("Players")

local function onPlayerAdded(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

	local coins = Instance.new("IntValue")
	coins.Name = "Coins"
	coins.Value = 0
	coins.Parent = leaderstats

	local level = Instance.new("IntValue")
	level.Name = "Level"
	level.Value = 1
	level.Parent = leaderstats
end

Players.PlayerAdded:Connect(onPlayerAdded)

Kill Brick

ObbyBeginner

A part that resets any player who touches it. Great for obbies. Just place this Script inside any Part named whatever you like.

Place in: Inside any Part
-- put this Script inside a Part
script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
	if humanoid then
		humanoid.Health = 0
	end
end)

Sprint (Hold Shift)

MovementBeginner

Hold Left Shift to sprint. A LocalScript that changes your walk speed while the key is down — the most requested Roblox script of all time.

Place in: StarterPlayerScripts
-- LocalScript in StarterPlayer > StarterPlayerScripts
local UserInputService = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer

local WALK_SPEED = 16
local SPRINT_SPEED = 26

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then return end
	if input.KeyCode == Enum.KeyCode.LeftShift then
		local char = player.Character or player.CharacterAdded:Wait()
		local humanoid = char:FindFirstChildOfClass("Humanoid")
		if humanoid then
			humanoid.WalkSpeed = SPRINT_SPEED
		end
	end
end)

UserInputService.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		local char = player.Character or player.CharacterAdded:Wait()
		local humanoid = char:FindFirstChildOfClass("Humanoid")
		if humanoid then
			humanoid.WalkSpeed = WALK_SPEED
		end
	end
end)

Day/Night Cycle

WorldAmbience

Makes a full day pass in 10 real minutes. Drop this server Script in and your game gets a living sky with zero configuration.

Place in: ServerScriptService
-- full day cycle every 10 minutes
local Lighting = game:GetService("Lighting")

local CYCLE_LENGTH = 600 -- seconds for a full day

while true do
	local currentMinutes = Lighting.ClockTime * 60
	currentMinutes = (currentMinutes + (1440 / CYCLE_LENGTH)) % 1440
	Lighting.ClockTime = currentMinutes / 60
	task.wait(0.1)
end

Double Jump

MovementFun

Let players jump twice in the air. Uses the Humanoid state machine the way Roblox recommends, so it works with all movement systems.

Place in: StarterPlayerScripts
-- LocalScript in StarterPlayerScripts
local UserInputService = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer

local MAX_JUMPS = 2
local jumpsUsed = 0

local function setupCharacter(character)
	local humanoid = character:WaitForChild("Humanoid")
	jumpsUsed = 0

	humanoid.StateChanged:Connect(function(_, newState)
		if newState == Enum.HumanoidStateType.Landed then
			jumpsUsed = 0
		end
	end)

	UserInputService.JumpRequest:Connect(function()
		if jumpsUsed < MAX_JUMPS then
			jumpsUsed += 1
			humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		end
	end)
end

if player.Character then
	setupCharacter(player.Character)
end
player.CharacterAdded:Connect(setupCharacter)

Touch Part = Give Tool

ItemsServer

A pad that gives the touching player a tool from ServerStorage. Perfect for weapon rooms, class selection, or reward areas.

Place in: ServerScriptService
-- ServerScriptService. Rename "Sword" to your tool's name.
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")

local TOOL_NAME = "Sword"
local COOLDOWN = 5

local lastGiven = {}

local pad = workspace:WaitForChild("GiveToolPad")

pad.Touched:Connect(function(hit)
	local player = Players:GetPlayerFromCharacter(hit.Parent)
	if not player then return end

	local now = os.clock()
	if lastGiven[player] and now - lastGiven[player] < COOLDOWN then
		return
	end
	lastGiven[player] = now

	local tool = ServerStorage:FindFirstChild(TOOL_NAME)
	if tool and not player.Backpack:FindFirstChild(TOOL_NAME) then
		tool:Clone().Parent = player.Backpack
	end
end)

Timed Door (Auto-Closes)

WorldIntermediate

A door that opens for 3 seconds when a player gets close, then closes again. Uses TweenService for smooth movement.

Place in: Inside the door Part
-- Script inside a Part named "TimedDoor"
local TweenService = game:GetService("TweenService")

local door = script.Parent
local OPEN_TIME = 3
local DETECTION_RANGE = 12

local isOpen = false
local closedCFrame = door.CFrame
local openCFrame = closedCFrame * CFrame.new(0, door.Size.Y - 0.2, 0)

local tweenInfo = TweenInfo.new(0.6, Enum.EasingStyle.Quad)

local function setOpen(open: boolean)
	if isOpen == open then return end
	isOpen = open
	TweenService:Create(door, tweenInfo, {
		CFrame = open and openCFrame or closedCFrame
	}):Play()
end

game:GetService("RunService").Heartbeat:Connect(function()
	local nearest = nil
	for _, player in game:GetService("Players"):GetPlayers() do
		local char = player.Character
		local root = char and char:FindFirstChild("HumanoidRootPart")
		if root and (root.Position - door.Position).Magnitude < DETECTION_RANGE then
			nearest = player
			break
		end
	end
	setOpen(nearest ~= nil)

	if isOpen then
		task.delay(OPEN_TIME, function()
			if (workspace:GetServerTimeNow() - lastSeen) > OPEN_TIME then
				setOpen(false)
			end
		end)
	end
end)

Welcome Message on Join

ChatBeginner

Shows a friendly chat message when a player joins. A gentle introduction to PlayerAdded events for new scripters.

Place in: ServerScriptService
-- greet every player who joins
local Players = game:GetService("Players")
local ChatService = game:GetService("Chat")

Players.PlayerAdded:Connect(function(player)
	task.wait(2)
	ChatService:Chat(
		workspace:FindFirstChild(player.Name),
		"Welcome to the game, " .. player.Name .. "!",
		Enum.ChatColor.Blue
	)
end)

How to Use a Roblox Script

Never added a script to a Roblox game before? Here is the whole process — it takes under a minute.

01

Open Roblox Studio

Create a new place or open your existing game. Make sure you are editing a game you own.

02

Paste the Script

Check the 'Place in' label on the script card. Right-click that container in the Explorer, insert a Script, and paste the code.

03

Press Play

Hit the Play button. The script runs automatically. Tweak the values at the top of each script to customize it.

Script Library FAQ

Are these Roblox scripts really free?

Yes. Every script on this page is free to use in your own games, including games you monetize. No attribution needed — though we appreciate a shoutout.

Will these scripts get my account banned?

No. These are normal Roblox Studio scripts, the same kind of code Roblox officially documents and teaches. Account bans happen when people inject scripts into games they do not own, which is a completely different activity.

The script I want is not here. What do I do?

Use our AI Roblox script generator. Describe what you need in plain English — 'a chest that gives random loot once per day' — and get a custom, commented Luau script in seconds.

Where exactly do I paste each script?

Every card shows a 'Place in' label. Server scripts usually go in ServerScriptService, player-local scripts in StarterPlayerScripts, and the kill brick script goes directly inside a Part. If you paste something and nothing happens, it is almost always in the wrong container.

Do these scripts work in 2026?

Yes. This library is actively maintained — whenever Roblox changes its API or deprecates a feature, the affected scripts get updated.

Can I share or sell games made with these scripts?

Absolutely. Scripts in the library are free for personal and commercial Roblox projects. You cannot resell the raw scripts as-is, but anything you build with them is yours.

Need a Script That's Not Here Yet?

Our AI generates custom Roblox scripts in seconds — with the same clean, commented style you see in this library.

Generate Your Custom Script