Getting started
Gobrix Studio is where you make Gobrix games. A game is a place: a world of parts, models and scripts, saved as a .gbrx file on your computer.
Studio opens on the Home page. Start from a template (Baseplate, Obby, Tycoon and more), open a place from your computer, or pick one of your recent places. You can get back to it any time with File › Home.
- File › New Place Ctrl+N, Open Place Ctrl+O, Save Ctrl+S and Save As Ctrl+Shift+S work like any other program. File › Open Recent lists the last 10 places you used.
- File › Import Parts copies the parts from another place into the one you have open, along with that place's Environment settings.
- Studio saves a backup of unsaved work every 3 minutes. If Studio closes unexpectedly, open the backup from Autosave backups on the Home page.
The Studio window
- Ribbon
- The tool bar at the top, with four tabs: HOME (tools, clipboard, inserting parts, testing), MODEL (parts, grouping, constraints, inserting objects), TEST (Play, Run, Stop) and VIEW (show or hide panels and the grid).
- Viewport
- The 3D view of your world in the middle.
- Explorer
- Everything in your game as a tree, under World, Players, Environment and Teams. Click to select, right-click for more options, use + to insert objects, and press F2 to rename. While you're testing, it also shows the players and their characters.
- Properties
- Settings for whatever you've selected: name, color, size, surfaces and more.
- Output
- Messages from Studio and your scripts (
print, warnings and errors).
Moving the camera
| Do this | To |
|---|---|
| Hold the right mouse button and move the mouse | Look around |
| W A S D | Fly forward, left, back and right |
| E / Q | Fly up / down |
| Hold Shift | Move slower, for careful building |
| Mouse wheel | Zoom in and out |
| F | Focus the camera on the selected part |
Building
Inserting parts
Click Part on the ribbon for a block, or use its little arrow (or the MODEL tab) for other shapes. New parts land on the ground in front of the camera.
| Shape | Starts as |
|---|---|
| Block | 4 × 1 × 2 |
| Ball | 2 units across |
| Cylinder | 2 × 2 × 2, lying along the X axis |
| Wedge | 4 × 1 × 2, a ramp rising toward the back (+Z) |
| SpawnLocation | Where players appear when the game starts. If there are several, players get a random one. |
Tools
| Tool | Key | What it does |
|---|---|---|
| Select | 1 | Click a part to select it. Click and hold to drag it around. |
| Move | 2 | Drag the arrows to move along the world's X, Y and Z axes. |
| Scale | 3 | Drag a face handle to resize. Hold Ctrl to grow both sides at once. |
| Rotate | 4 | Drag a ring to turn around that axis, in 15° steps. |
Moving snaps to a 1-unit grid, so parts line up easily.
Selecting, copying and grouping
- Ctrl+click parts to select more than one.
- Copy Ctrl+C, Cut Ctrl+X, Paste Ctrl+V, Duplicate Ctrl+D, Delete Del.
- Undo Ctrl+Z and Redo Ctrl+Y.
- Group Ctrl+G puts the selected parts in a Model, so you can move them together. Ungroup Ctrl+U takes them back out.
- Folders help you organize the Explorer. They don't change how anything works.
- Anchor on the ribbon locks parts in place. Anchored parts never move, not even when something hits them.
Parts and properties
Select a part and change it in the Properties panel.
| Property | What it does |
|---|---|
| Name | What it's called in the Explorer and in scripts. |
| Position, Size | Where it is and how big it is, in units. |
| Color | The part's color. |
| Transparency | 0 is solid, 1 is invisible. |
| Anchored | Anchored parts never move. |
| CanCollide | Turn it off and players and parts pass straight through. |
| KillsOnTouch | A kill brick: touching it takes the player's health to 0. |
| Elasticity, Density | How bouncy and how heavy it is. |
| Surfaces | Each face can be Smooth, Studs, Inlets, Universal, Weld, Glue, Hinge or Motor. Surfaces make joints when the game starts (see Welds, hinges and joints). Paint them with the Surface tool or set them in Properties › Surface. |
Every part is smooth plastic: there are no materials, just colours, so every build has the same bright brick look.
Welds, hinges and joints
Joints come from the surfaces of parts. When the game starts, every face joins its part to whatever touches that face:
| Surface | Joins to the touching part… |
|---|---|
| Studs, Inlets, Universal | Studs snap into Inlets (the classic brick). Universal snaps to either. |
| Weld, Glue | Stuck together. |
| Hinge | The touching part turns freely around a yellow pin through the middle of the face (doors, wheels). |
| Motor | Like Hinge, but it keeps turning the touching part. |
| Smooth | Nothing. |
Use the Surface tool on the toolbar: pick a surface, then click faces of parts. Parts that are snapped, welded or glued together move as one solid piece, and if any of them is anchored the whole piece stays put.
For a joint between two parts you choose, use Insert › Joint (advanced): pick one, click the first part, then click the second part. Press Esc to cancel. Parts joined this way don't collide with each other.
| Constraint | What it does | Good for |
|---|---|---|
| Weld | The two parts move as one, exactly as you placed them. | Cars, vehicles, anything made of several parts that moves |
| Hinge | The second part turns around an axis. The face you click on the first part sets the axis. It has a motor: turn on MotorEnabled and set its Speed (degrees per second) and MaxTorque (how hard it pushes). | Doors, wheels, spinners, fans |
| Ball Socket | The second part swings freely in any direction around the joint. | Pendulums, chains, wrecking balls |
Create Store
The Create Store has Free Models (ready-made builds), Decals (images) and Meshes (3D models) that anyone can use in their games. Everything in it is made by players and checked by a moderator.
- Search by name, creator or ID. Each asset's page shows its ID and how to use it.
- Upload your own on Create › Decals or Create › Meshes. Once approved, it's in the store for everyone.
- In Studio, the Decal and Mesh properties have a button that opens the store.
Toolbox and Free Models
The Toolbox (the toolbox button on the toolbar, or View › Toolbox) shows the Create Store right inside Studio, down the left side.
- Pick Free Models, Decals or Meshes, and search by name, creator or ID.
- Click a Free Model to drop it in front of the camera. It comes in selected, ready to move.
- Click a Decal to stick it on the selected part's front, or a Mesh to insert a MeshPart.
- Create Store at the bottom of the Toolbox opens the store in your browser.
Publishing your own: sign in, select a Model (or a part), and choose File › Publish to Create Store. Studio takes a picture of it, then a moderator checks it. You can insert your own models from the Toolbox (My Models) straight away.
Free models can contain scripts. Check what they do in the Explorer before you publish a game with one.
Decals
Decals put a picture on a face of a part, like a sign, poster or logo.
- Find one in the Create Store, or upload your image on Create › Decals (once a moderator approves it, it's in the store). Note its Decal ID.
- In Studio, select a part and insert a Decal (ribbon or right-click › Insert Object).
- Set its Texture to the Decal ID and its Face to the side it should go on (Front, Back, Top, Bottom, Left or Right).
Meshes (MeshParts)
A MeshPart is a part shaped like a 3D model from the Create Store: a chest, a tree, a car.
- Find a mesh in the Create Store and note its Mesh ID, or upload your own .obj (with an optional PNG or JPG texture) on Create › Meshes. In Blender: File › Export › Wavefront (.obj).
- In Studio, choose Insert Object › MeshPart.
- In Properties › Mesh, type the ID into MeshId and press Enter. Once it downloads, the part takes the mesh's own size.
- The mesh stretches to fill the part's Size, so you can resize it like any part.
- A mesh with a texture shows its texture; without one it uses the part's Color.
- MeshParts collide as a box the size of the part.
- Scripts:
local part = Instance.new("MeshPart"),part.MeshId = "12",part.Parent = workspace.
Sounds and Audio
A Sound plays Audio from the Create Store in your game: music, footsteps, a coin pickup. (Needs Gobrix Studio 0.2.7 and Gobrix 0.7.6.)
- Find a sound in the Create Store › Audio, or upload your own on Create › Audio (MP3, OGG or WAV; a moderator checks it first).
- In Studio, open the Toolbox, choose Audio and click a sound (right-click › Preview to hear it). It adds a Sound to the selected part, or to the World. Or use Insert Object › Sound and type the Audio ID into SoundId.
- Turn on Playing to start it when the game starts, and Looped to repeat it (music).
- A Sound in a part is heard around that part and fades out with distance. Anywhere else (the World, a Model, a Folder) everyone hears it the same everywhere.
- Volume: 0 is silent, 1 is full. PlaybackSpeed: 2 plays it twice as fast and an octave higher.
- Scripts:
sound:Play()starts it from the top,sound:Stop()stops it,sound.Playingsays whether it's playing (a one-shot sets it back to false when it ends).
-- A coin that plays a sound when touched (put a Sound named "Ding" in the coin)
local coin = script.Parent
coin.Touched:Connect(function(hit)
coin.Ding:Play()
end)
Environment
Select Environment in the Explorer to change the time of day and the mood of your game.
| Property | What it does |
|---|---|
| ClockTime | Time of day from 0 to 24 (14 is the afternoon, 0 is midnight). |
| Brightness | How strong the sunlight is. |
| Ambient, OutdoorAmbient | The color of the light in shadows, indoors and outdoors. |
| FogStart, FogEnd, FogColor | Fog that fades the world out with distance. |
| GlobalShadows | Turns shadows on or off. |
| GeographicLatitude | Changes the sun's path across the sky. |
Testing your game
| Button | Key | What it does |
|---|---|---|
| Play | F5 | Play your game with a character, at a SpawnLocation. Scripts run. |
| Run | F8 | Run physics and scripts without a character, so you can watch the world from the editor camera. |
| Pause / Resume | Freeze the simulation while running. | |
| Stop | Shift+F5 | Stop and put everything back where it was. |
While you're playing: WASD walk, Space jumps, hold the right mouse button to look around, the mouse wheel zooms, and Shift turns on shift lock.
Press Esc for the game menu. It lists the players in the server, has settings (volume, camera sensitivity, invert camera, FPS counter and, in the game, fullscreen), and buttons to Reset Character R, leave L, or resume Esc.
Publishing
- Log In with your Gobrix account using the button at the top of Studio.
- Choose File › Publish to Gobrix.
- Go to Create on the website, where your game shows up. Click it to set its name, description and thumbnail, and choose who can play.
To update a game, publish it again. Players get the new version the next time they join.
Multiplayer
- Up to 12 players can be in one server. When it's full, the next players get a new server of the same game.
- Scripts run on one player's game (the host), and what they change is sent to everyone.
- When you push a loose part, your game takes over simulating it, so shoving things around feels smooth.
- Click a name on the player list (or in the Esc menu) to send a friend request or view their profile. A heart marks your friends.
Tools
Tools are things players hold: swords, blasters, building tools. A Tool's part named Handle goes in the character's right hand, and its other parts come along around it.
- In the Explorer, click + next to StartingTools (or right-click › Insert Tool). You get a Tool with a Handle.
- To build it, uncheck In StartingTools (those tools aren't in the world), then build around the Handle and check it again. The Handle goes in the fist of the outstretched arm with its Front face pointing up (a sword built pointing toward -Z is held upright) and its Top facing back; the other parts come along around it.
- Put a Script inside the Tool.
Activatedfires when the player clicks while holding it.
- Tools in StartingTools are given to every player each time their character spawns. They aren't in the world while you edit or play.
- A Tool in the World is picked up by touching its Handle (Insert Object › Tool).
- Players press 1–9 (or click the hotbar) to hold a tool, press the key again to put it away, click to use it, and press Backspace to drop it.
- Properties:
ToolTip,Enabled,RequiresHandle,CanBeDropped,GripPos(where on the Handle the hand holds it) andGripRotation(how it's turned in the hand, in degrees around the Handle's own X, Y and Z). - Setting up the grip: select the Tool in Studio and a character appears next to it, holding a copy exactly like in game. Change GripPos and GripRotation (or use the Turn 90° buttons) and watch it update. Meshes often need a quarter turn or two.
A simple sword
local tool = script.Parent
local swinging = false
tool.Handle.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
if swinging and humanoid and hit.Parent ~= tool.Parent then
humanoid:TakeDamage(25)
end
end)
tool.Activated:Connect(function()
swinging = true
local anim = Instance.new("StringValue") -- plays the slash animation
anim.Name = "toolanim"
anim.Value = "Slash" -- or "Lunge"
anim.Parent = tool
task.wait(0.35)
anim:Destroy()
swinging = false
end)
Aiming with the mouse
local tool = script.Parent
tool.Activated:Connect(function()
local player = game.Players:GetPlayerFromCharacter(tool.Parent)
local mouse = player:GetMouse()
print("Clicked on", mouse.Target, "at", mouse.Hit.Position)
end)
Teams
Teams split players into groups. The player list groups players by team, and name tags take the team's color.
- In the Explorer, click + next to Teams (or right-click › Insert Team). Each new team gets its own color.
- Select a team to set its Name, TeamColor and AutoAssignable. New players join the AutoAssignable team with the fewest players.
- To give a team its own spawn, select a SpawnLocation, turn off Neutral and pick the team in the Team list. Neutral spawns are used by everyone.
Changing teams with a script
local Teams = game:GetService("Teams")
local red = Teams:FindFirstChild("Red Team")
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and red then
player.Team = red
end
end)
Scripting basics
Gobrix scripts are written in Luau, a fast, friendly scripting language based on Lua. If you have written Lua before, you'll feel at home.
- Insert a Script (ribbon › Script, or right-click › Insert Object) into the World or into a part. Double-click it to edit.
- When the game starts, every enabled Script runs, in the order they appear in the Explorer.
scriptis the Script itself, soscript.Parentis whatever it's inside.print()andwarn()write to the Output panel. Errors show up there too, with the line number.- Loops must wait. A script that runs for 5 seconds without waiting is stopped with an error, so
while true do endcan't freeze your game. Puttask.wait()in every loop.
game:GetService("ReplicatedStorage") and workspace are fine.require(module). Nothing runs in SharedStorage or ServerVault until it's cloned out.The server and the players (LocalScripts)
A Gobrix game has two sides:
- The server runs Scripts. In a multiplayer game that's the host's computer; what server scripts change (parts, Environment, the leaderboard, health) is sent to everyone.
- Each player's own game runs LocalScripts. They see the same world and get the keyboard, the mouse and the camera, but what they change in the world only that player sees.
Containers in the Explorer
- SharedStorage
- Both sides can see it. Keep RemoteEvents, ModuleScripts and models to clone here. Nothing in it is in the world.
- ServerVault
- Only Scripts see it: maps, prizes and tools waiting to be cloned in. LocalScripts can't use it.
- ServerScripts
- Scripts that run on the server, out of the way of the World.
- PlayerSetup › PlayerScripts
- LocalScripts here run once on each player's game when they join.
- PlayerSetup › CharacterScripts
- Copied into each character when it spawns, so
script.Parentis the character. LocalScripts run on that player's game, Scripts on the server.
Drag things onto these rows to move them, or right-click a row › Insert Object.
RemoteEvents: talking across
Make a RemoteEvent in SharedStorage in Studio (right-click SharedStorage › Insert Object, or its +). Then:
-- LocalScript (PlayerScripts)
local remote = game.SharedStorage:WaitForChild("Shout")
remote:FireServer("Hello!", Vector3.new(1, 2, 3))
remote.OnClientEvent:Connect(function(text)
print("The server says", text)
end)
-- Script (ServerScripts)
local remote = game.SharedStorage.Shout
remote.OnServerEvent:Connect(function(player, text, position)
print(player.Name, "said", text)
remote:FireAllClients(player.Name .. " shouted!") -- or remote:FireClient(player, ...)
end)
A RemoteFunction asks and waits for an answer: the server sets remote.OnServerInvoke = function(player, ...) return ... end and a LocalScript calls local answer = remote:InvokeServer(...). Arguments can be numbers, strings, booleans, tables, Vector3, Color3, CFrame, parts, objects and players.
Instance.new: a remote a script makes only exists on the computer that made it. Never trust what a player sends: check it on the server (is the player close enough, do they have enough coins).More ways for scripts to work together
ModuleScriptlocal lib = require(game.SharedStorage.Lib)runs it once (per side) and gives back what it returns, usually a table of functions. It can'twait()at its top level.BindableEvent/BindableFunction- Scripts on the same side:
bindable:Fire(...)withbindable.Event:Connect(f);bf.OnInvoke = function(...) return x endwithbf:Invoke(...). ClickDetector- Put one in a part (or a Model). Clicking it fires
detector.MouseClick:Connect(function(player) ... end)on the server and on the clicking player's LocalScripts. AlsoRightMouseClick,MouseHoverEnter,MouseHoverLeave(LocalScripts) andMaxActivationDistance(32). The cursor turns into a hand over it. Message/Hint- A Message with
Textin the World dims everyone's screen with big text in the middle; a Hint shows a bar along the top. ChangeTextorDestroy()it. Debrisgame:GetService("Debris"):AddItem(thing, seconds)destroys it later.
Input and the camera
These work in LocalScripts.
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end -- typing in the chat
if input.KeyCode == Enum.KeyCode.E then
print("E pressed")
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
print("click at", input.Position.X, input.Position.Y)
end
end)
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:Connect(function()
print("clicked", mouse.Target, mouse.Hit.Position)
end)
mouse.KeyDown:Connect(function(key) print(key) end) -- the character typed: "e", " "...
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CFrame.new(Vector3.new(0, 50, 30), Vector3.new(0, 0, 0))
UserInputService- Events
InputBegan,InputEnded,InputChanged(mouse movement, the wheel) with an input that hasKeyCode,UserInputType,UserInputState,PositionandDelta.IsKeyDown(Enum.KeyCode.X),IsMouseButtonPressed,GetMouseLocation(),GetKeysPressed(),MouseBehavior(Enum.MouseBehavior.LockCenterlocks the cursor in the middle),MouseIconEnabled. - Mouse (
player:GetMouse()) - Live in LocalScripts:
Hit,Target,Origin,UnitRay,X,Y,ViewSizeX/Y,TargetFilter,Icon. EventsButton1Down/Up,Button2Down/Up,Move,WheelForward,WheelBackward,KeyDown(key),KeyUp(key). In a server Script, a Tool'sEquipped(mouse)mouse hasHit,TargetandButton1Down/Up. ContextActionServiceBindAction(name, function(name, state, input) end, false, Enum.KeyCode.F, ...)andUnbindAction(name).workspace.CurrentCameraCFrame,CameraType(Customfollows the character,Scriptablegoes where you put it,Fixedstays put),CameraSubject(a part to follow instead of the character),FieldOfView,ViewportSize,ScreenPointToRay(x, y),WorldToScreenPoint(position).Players.LocalPlayer- This player (only in LocalScripts).
RunService:IsClient()is true there.
Seats, conveyors and body movers
- Seat
- Insert › Seat. Characters sit when they touch it, facing its front (-Z), and Space gets up. Scripts:
seat.Occupant(a Humanoid),seat.Disabled,humanoid.Sit,humanoid.SeatPart,humanoid.Seated:Connect(function(sitting, seat) end);humanoid.Sit = falsestands them up. - VehicleSeat
- Weld it to a car. Sitting in it, W/S drive the car along the seat's front and A/D turn it.
MaxSpeed,Torque,TurnSpeed, andThrottle/Steer(-1, 0, 1) for scripts. Wheels on hinges roll along. In multiplayer the driver's game drives the car. - Conveyors
- Anchor a part and give it a Velocity (Properties › Conveyor, or
part.Velocity = Vector3.new(10, 0, 0)). The part stays put; whatever stands on it, characters and parts, is carried along at that speed. - Body movers
- Put one inside a part.
BodyVelocity(Velocity,MaxForce,P) pushes toward a speed,BodyPosition(Position,MaxForce,P,D) pulls to a spot and holds it,BodyGyro(CFrame,MaxTorque) keeps it turned a way,BodyForce(Force) is a constant push,BodyAngularVelocity(AngularVelocity,MaxTorque) spins it. They push whatever the part is welded to as well. - More values
ObjectValue(a part or object),Vector3ValueandColor3Value.
Script examples
Kill brick
Put this Script inside a part. (Or just turn on the part's KillsOnTouch property.)
local part = script.Parent
part.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end)
Leaderboard (leaderstats)
A folder named leaderstats inside a player shows its values on the leaderboard.
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(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
end)
Coin you can collect
Put this inside a part. It works with the leaderboard script above.
local coin = script.Parent
local Players = game:GetService("Players")
local taken = false
coin.Touched:Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
if player and not taken then
taken = true
local coins = player.leaderstats.Coins
coins.Value = coins.Value + 1
coin.Transparency = 1
task.wait(5) -- comes back after 5 seconds
coin.Transparency = 0
taken = false
end
end)
Spinning part
Put this inside an anchored part.
local part = script.Parent
while true do
part.CFrame = part.CFrame * CFrame.Angles(0, math.rad(3), 0)
task.wait()
end
Disappearing platform
local platform = script.Parent
while true do
task.wait(2)
platform.Transparency = 0.8
platform.CanCollide = false
task.wait(2)
platform.Transparency = 0
platform.CanCollide = true
end
Day and night cycle
local Environment = game:GetService("Environment")
while true do
Environment.ClockTime = (Environment.ClockTime + 0.01) % 24
task.wait(0.1)
end
Speed pad
local pad = script.Parent
pad.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = 40
task.wait(3)
humanoid.WalkSpeed = 16
end
end)
Make parts with a script
for i = 1, 10 do
local part = Instance.new("Part")
part.Size = Vector3.new(4, 1, 4)
part.Position = Vector3.new(i * 5, 2 + i * 2, 0)
part.Color = Color3.fromRGB(255, 80, 80)
part.Anchored = true
part.Parent = workspace
end
Scripting reference
Everything Gobrix scripts can use today.
Globals
game,workspace(orworld),script- The game, the World and the running Script.
game:GetService(name)getsWorld,Players,RunService,Environment,Teams,StartingTools,SharedStorage,ServerVault,ServerScripts,PlayerSetup,UserInputService,ContextActionServiceorDebris. require(moduleScript)- Runs a ModuleScript once and returns what it returned.
Instance.new(className, parent?)- Makes a
Part,WedgePart,SpawnLocation,MeshPart,TrussPart,Seat,VehicleSeat,Model,Folder,Decal,Sound, the values (IntValue,NumberValue,StringValue,BoolValue,ObjectValue,Vector3Value,Color3Value),Humanoid,Team,Tool,RemoteEvent,RemoteFunction,BindableEvent,BindableFunction,ClickDetector, the body movers,Message,HintorExplosion. task.wait(t),task.spawn(f),task.delay(t, f),task.defer(f),task.cancel(thread)- Waiting and running code later. The older
wait,spawnanddelaywork too. print,warn,tick(),time(),typeof(v)- Output, time and type helpers.
Value types
Vector3Vector3.new(x, y, z),.zero,.one,.xAxis/.yAxis/.zAxis. FieldsX Y Z,Magnitude,Unit. MethodsDot,Cross,Lerp,FuzzyEq,Abs,Floor,Ceil,Min,Max. Math with+ - * /.CFrame- A position plus a rotation.
CFrame.new(x, y, z),CFrame.new(pos, lookAt),CFrame.lookAt,CFrame.Angles(rx, ry, rz),fromEulerAnglesXYZ/YXZ,fromOrientation,fromAxisAngle,CFrame.identity. FieldsPosition,LookVector,RightVector,UpVector,X Y Z. MethodsInverse,Lerp,ToWorldSpace,ToObjectSpace,PointToWorldSpace,PointToObjectSpace,VectorToWorldSpace,VectorToObjectSpace,ToEulerAnglesXYZ/YXZ,ToOrientation,GetComponents.cf * cfandcf * vectorwork. Color3Color3.new(r, g, b)(0 to 1),Color3.fromRGB(r, g, b)(0 to 255),fromHSV,fromHex("#ff0000"). FieldsR G B. MethodsLerp,ToHSV.BrickColorBrickColor.new("Bright red"),BrickColor.Random(),BrickColor.Red()and friends. FieldsName,Color.EnumEnum.Material(kept so old scripts run; every part stays Plastic),Enum.NormalId,Enum.PartType,Enum.RaycastFilterType,Enum.KeyCode,Enum.UserInputType,Enum.UserInputState,Enum.CameraTypeandEnum.MouseBehavior, e.g.Enum.NormalId.Top.
Every instance
Name, Parent, ClassName, Destroy(), Clone(), FindFirstChild(name, recursive?), FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstAncestor…, WaitForChild(name), GetChildren(), GetDescendants(), IsA(class), IsDescendantOf, IsAncestorOf, GetFullName(), ClearAllChildren(), GetAttribute, SetAttribute, GetAttributes, GetPropertyChangedSignal(prop). Events: Changed, ChildAdded, ChildRemoved, Destroying.
Events: event:Connect(f) returns a connection you can :Disconnect(). There's also event:Once(f) and event:Wait().
Part
Position, Size, CFrame, Orientation, Rotation, Color, BrickColor, Transparency, Anchored, CanCollide, Shape, Locked, Velocity / AssemblyLinearVelocity, AssemblyAngularVelocity, Elasticity, KillsOnTouch, Mass, MeshId (MeshParts). Methods ApplyImpulse(force), ApplyAngularImpulse, GetMass(), GetTouchingParts(), BreakJoints(). Events Touched(otherPart) and TouchEnded(otherPart).
Model and Folder
Model: PrimaryPart, GetPivot(), PivotTo(cframe), MoveTo(position), SetPrimaryPartCFrame, TranslateBy(offset), GetBoundingBox(), GetExtentsSize(). Folder just holds things.
Parts can go in the World, a Model or a Folder, but not inside another part (group them in a Model instead).
Values, Decals and Scripts
IntValue, NumberValue, StringValue and BoolValue have a Value and a Changed event. Decal (inside a part) has Texture (a Decal ID), Face and Transparency. A Script has Enabled. A Sound has SoundId (an Audio ID), Volume, PlaybackSpeed, Looped and Playing, and Play(), Stop(), Pause() and Resume().
Players
PlayersGetPlayers(),GetPlayerFromCharacter(model),GetPlayerByUserId(id),RespawnTime,MaxPlayers. EventsPlayerAdded,PlayerRemoving.PlayerName,DisplayName,UserId,Character,LoadCharacter(),Team,TeamColor,Neutral,Backpack,GetMouse()(Hit,Target,Origin: where the player last clicked). EventsCharacterAdded,CharacterRemoving. Aleaderstatsfolder inside shows on the leaderboard.- Character
- A Model with a
Humanoid,Head,Torso,HumanoidRootPartand the arms and legs. Move it withcharacter:PivotTo(cframe). HumanoidHealth,MaxHealth,WalkSpeed(16),JumpPower(50),RootPart,TakeDamage(amount),EquipTool(tool),UnequipTools(). EventsDied,HealthChanged.- Name tags
- Put a
Humanoidin any Model that has a part namedHead, and the Model's name shows above the head, like a player's. Handy for signs and buttons.
Services
WorldRaycast(origin, direction, params?)withRaycastParams.new()(FilterType,FilterDescendantsInstances), returningInstance,Position,Normal,DistanceandMaterial. AlsoGetPartBoundsInRadius(pos, radius),GetPartBoundsInBox(cframe, size),GravityandDistributedGameTime.RunService- Events
Heartbeat(dt),Stepped,RenderStepped.IsServer(),IsClient(),IsStudio(). EnvironmentClockTime,TimeOfDay,Brightness,FogStart,FogEnd,FogColor,Ambient,OutdoorAmbient,GeographicLatitude,GetMinutesAfterMidnight(),SetMinutesAfterMidnight(m).ToolEnabled,RequiresHandle,ToolTip,CanBeDropped,GripPos,GripRotation,Grip(a CFrame),GripForward/GripUp/GripRight,Activate(),Deactivate(). EventsEquipped(mouse),Unequipped,Activated,Deactivated. While held,tool.Parentis the character; otherwise it's inplayer.Backpack.StartingTools- Tools every player gets when they spawn (
game.StartingTools). TeamsGetTeams(). EachTeamhasTeamColor,AutoAssignableandGetPlayers(). ASpawnLocationhasNeutralandTeamColor.
Units and numbers
Distances are in units: one unit is the width of one stud on a brick.
| Thing | Value |
|---|---|
| Character height | 5 units |
| Default part (block) | 4 × 1 × 2 |
| Walk speed | 16 units per second |
| Jump power | 50 (about 6.4 units high) |
| Gravity | 196.2 |
| Steps you can walk up without jumping | 0.6 units |
| Steepest slope you can walk up | 55° |
| Falling off the world | Below Y = −200, characters die and loose parts stop |
| Players per server | 12 |
Keyboard shortcuts
| Keys | Action |
|---|---|
| 1 2 3 4 | Select, Move, Scale, Rotate tools |
| Ctrl+C / X / V / D | Copy, Cut, Paste, Duplicate |
| Ctrl+Z / Y | Undo, Redo |
| Ctrl+G / U | Group, Ungroup |
| Del | Delete |
| F | Focus on the selection |
| F5 / F8 / Shift+F5 | Play, Run, Stop |
| Ctrl+N / O / S / Shift+S | New, Open, Save, Save As |
| Ctrl+A | Select all parts |
| F2 | Rename the selection |
| Esc | Game menu (while playing) |
| 1–9, 0 / Backspace | Hold a tool / drop it (while playing) |
| R / L | Reset character, leave (in the game menu) |
Stuck? Ask in the Forums.