Roblox Script Generator for Studio
Roblox Script Generator by ThumbBlox creates free Luau starter scripts for your own Roblox Studio experience.
Luau output
The Roblox script generator by ThumbBlox is a free browser tool for creators adding a checkpoint, timed door, coin pickup, or GUI toggle to their own Studio experience. Choose a template to get Luau code, the script type, and the exact spot in Explorer for each file. Preview, copy, and download the code without an account, credits, or added watermark.
How to make a Luau script
ThumbBlox makes a starter Luau script for the mechanic you choose. Each template has one setting and generates the script files along with the objects you need in Explorer. Copy or download the output, then use Studio's Play test to check the result in your experience.
- Choose a checkpoint, timed door, coin pickup, or GUI toggle and adjust its setting.
- Generate the files, then create the listed objects and match their names in Studio.
- Create the indicated script type at each listed location, paste the code, and start a Play test. Check Output if an object is missing.
Luau script examples
These examples show what each template generates with its default setting. The checkpoint, door and coin templates run on the server. The GUI toggle runs for the player who presses it. Open an example to see the file names, code and the path where each file goes.
Obby checkpoint
Track the last checkpoint a player reaches in numbered order and respawn them four studs above it during the same session.
--!strict
-- Add anchored, touch-enabled Parts named Checkpoint1, Checkpoint2, etc.
-- Put them in Workspace > Checkpoints before pressing Play.
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local RESPAWN_HEIGHT = 4
local folder = workspace:WaitForChild("Checkpoints", 10)
assert(folder and folder:IsA("Folder"), "Create a Folder named Checkpoints in Workspace")
type Progress = { stage: number, part: BasePart }
local progress: { [Player]: Progress? } = {}
local function livingPlayerFromTouch(hit: BasePart): Player?
local character = hit:FindFirstAncestorOfClass("Model")
if not character or not character:IsA("Model") then return nil end
local player = Players:GetPlayerFromCharacter(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not player or player.Character ~= character or not humanoid or humanoid.Health <= 0 then
return nil
end
return player
end
local function watchPlayer(player: Player)
player.CharacterAdded:Connect(function(character)
local current = progress[player]
if not current then return end
local root = character:WaitForChild("HumanoidRootPart", 10)
if not root then return end
-- CharacterAdded can fire before the engine positions the new character.
local deadline = time() + 10
while not character:IsDescendantOf(workspace) do
if player.Character ~= character or time() >= deadline then return end
RunService.Heartbeat:Wait()
end
RunService.Heartbeat:Wait()
if player.Character == character and character:IsDescendantOf(workspace) and current.part:IsDescendantOf(folder) then
local height = current.part.Size.Y / 2 + RESPAWN_HEIGHT
character:PivotTo(CFrame.new(current.part.Position + Vector3.new(0, height, 0)))
end
end)
end
Players.PlayerAdded:Connect(watchPlayer)
for _, player in Players:GetPlayers() do
watchPlayer(player)
end
Players.PlayerRemoving:Connect(function(player)
progress[player] = nil
end)
for _, part in folder:GetChildren() do
local stage = tonumber(string.match(part.Name, "^Checkpoint([1-9]%d*)$") or "")
if part:IsA("BasePart") and part.Anchored and part.CanTouch and stage then
part.Touched:Connect(function(hit)
local player = livingPlayerFromTouch(hit)
if not player then return end
local current = progress[player]
local nextStage = if current then current.stage + 1 else 1
if stage == nextStage then
progress[player] = { stage = stage, part = part }
end
end)
end
end
Timed door
Open an anchored door when a player uses its proximity prompt, then close it after three seconds.
--!strict
-- Put this Script and a ProximityPrompt under an anchored Door Part.
local TweenService = game:GetService("TweenService")
local OPEN_SECONDS = 3
local door = script.Parent
assert(door and door:IsA("BasePart") and door.Anchored, "Put this Script under an anchored Door Part")
local prompt = door:FindFirstChildOfClass("ProximityPrompt")
assert(prompt, "Add a ProximityPrompt to the Door Part")
local closed = door.CFrame
local opened = closed + Vector3.new(0, door.Size.Y + 0.2, 0)
local slide = TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local busy = false
local function moveTo(target: CFrame)
local tween = TweenService:Create(door, slide, { CFrame = target })
tween:Play()
tween.Completed:Wait()
tween:Destroy()
end
prompt.Triggered:Connect(function(player)
local character = player.Character
if busy or not prompt.Enabled or not character then return end
local humanoid = character:FindFirstChildOfClass("Humanoid")
local root = character:FindFirstChild("HumanoidRootPart")
if not humanoid or humanoid.Health <= 0 or not root or not root:IsA("BasePart") then return end
if (root.Position - door.Position).Magnitude > prompt.MaxActivationDistance then return end
busy = true
prompt.Enabled = false
moveTo(opened)
task.wait(OPEN_SECONDS)
moveTo(closed)
prompt.Enabled = true
busy = false
end)
Coin pickup and leaderboard
Award one coin on pickup and see the new total on the in-game leaderboard. Set up both scripts for this example.
--!strict
-- Add this Script once in ServerScriptService.
local Players = game:GetService("Players")
local function prepareLeaderboard(player: Player)
local stats = player:FindFirstChild("leaderstats")
if not stats then
local folder = Instance.new("Folder")
folder.Name = "leaderstats"
folder.Parent = player
stats = folder
end
if not stats or not stats:IsA("Folder") or stats:FindFirstChild("Coins") then return end
local balance = Instance.new("IntValue")
balance.Name = "Coins"
balance.Parent = stats
end
Players.PlayerAdded:Connect(prepareLeaderboard)
for _, player in Players:GetPlayers() do
prepareLeaderboard(player)
end
--!strict
-- Put this Script under each anchored, touch-enabled Coin Part.
local Players = game:GetService("Players")
local COIN_REWARD = 1
local coin = script.Parent
assert(coin and coin:IsA("BasePart") and coin.Anchored, "Put this Script under an anchored Coin Part")
local collected = false
local function livingPlayerFromTouch(hit: BasePart): Player?
local character = hit:FindFirstAncestorOfClass("Model")
if not character or not character:IsA("Model") then return nil end
local player = Players:GetPlayerFromCharacter(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not player or player.Character ~= character or not humanoid or humanoid.Health <= 0 then
return nil
end
return player
end
coin.Touched:Connect(function(hit)
if collected then return end
local player = livingPlayerFromTouch(hit)
if not player then return end
local stats = player:FindFirstChild("leaderstats")
local balance = if stats and stats:IsA("Folder") then stats:FindFirstChild("Coins") else nil
if not balance or not balance:IsA("IntValue") then return end
collected = true
balance.Value += COIN_REWARD
coin:Destroy()
end)
GUI panel toggle
Use a button to show or hide a CanvasGroup panel with a quarter-second fade.
--!strict
-- Put this LocalScript inside ToggleButton (a TextButton).
-- Keep the Panel (a CanvasGroup) next to ToggleButton in the ScreenGui.
local TweenService = game:GetService("TweenService")
local FADE_SECONDS = 0.25
local button = script.Parent
assert(button and button:IsA("TextButton"), "Put this LocalScript inside ToggleButton")
local screenGui = button.Parent
assert(screenGui and screenGui:IsA("ScreenGui"), "Put ToggleButton directly in a ScreenGui")
local panel = screenGui:WaitForChild("Panel", 10)
assert(panel and panel:IsA("CanvasGroup"), "Add a CanvasGroup named Panel next to ToggleButton")
local busy = false
local isOpen = false
panel.Visible = false
panel.GroupTransparency = 1
button.Activated:Connect(function()
if busy then return end
busy = true
isOpen = not isOpen
if isOpen then panel.Visible = true end
local transparency = if isOpen then 0 else 1
if FADE_SECONDS > 0 then
local tween = TweenService:Create(panel, TweenInfo.new(FADE_SECONDS), { GroupTransparency = transparency })
tween:Play()
tween.Completed:Wait()
tween:Destroy()
end
panel.GroupTransparency = transparency
panel.Visible = isOpen
busy = false
end)
Can I use this Roblox script maker for free?
ThumbBlox lets you generate, preview, copy, and download all four Luau templates for $0 in your browser. You can use the generator without signing in, installing a plugin, or spending credits. Download a .lua file if you want to save the code, or copy it directly into your Studio project.
Where do these scripts go in Roblox Studio?
The Roblox script generator by ThumbBlox lists each file’s script type and exact path in Explorer. Put the checkpoint manager and coin leaderboard in ServerScriptService. Put the door and coin pickup scripts under their Parts in Workspace. The GUI template is a LocalScript under a TextButton inside StarterGui, where it can handle each player's button input.
Price and credits
ThumbBlox lets you generate and export every script for $0. The page shows every file in plain text, including both files when you choose coins. You can copy or download every file individually. Each of those actions uses zero credits, and the exported code contains no watermark.
| Action | Price | Included |
|---|---|---|
| Generate and preview | $0 · 0 credits | All four templates, file types, and Studio paths |
| Copy or download | $0 · 0 credits | Every .lua file, without a watermark |
What the templates cover
ThumbBlox generates starter scripts for checkpoints, timed doors, coin pickups, and GUI toggles in Roblox experiences you control. The code expects the object names and classes listed in setup, so create those objects first and test with Studio's Output window open. Checkpoint and coin progress lasts for the current session. Saving progress across sessions or combining mechanics with custom systems requires additional Studio work.
Design a panel with the Roblox UI MakerFAQ
Is Roblox scripting written in Lua or Luau?
Roblox Studio uses Luau, which is derived from Lua. These files use Roblox engine features such as ProximityPrompt and StarterGui, so place them in a Roblox Studio experience.
How does this differ from a Roblox AI script generator?
An AI tool can take a free-form description. This tool assembles one of four built-in templates and changes the setting you choose, so Studio file names and setup steps stay consistent.
Can I make a script on my phone?
Yes. Open the tool in your mobile browser to generate or download the code. Open the Roblox Studio project on a computer when you are ready to add and playtest the script.