Gizlo scripting

Every Gizlo script is visual nodes and JavaScript at once: build it with nodes, or write it as code, and switch any time. Below: the game API every script can use, then every node: what it does, what you fill in, and what it gives back. Server scripts run the shared game world; Local scripts run on one player's screen (their GUI). Any box can take a variable instead: type $name or drag the variable onto it. Or code: start a box with =, like =$coins * 2 or =players().length. Function, Call, Return, While and Code nodes (and = boxes) work in Server and Local scripts.

Your script as code
// Server script: a coin that pays out and comes back later.
onTouch(World.Coin, async (hit, player) => {
  if (!player) return;
  player.addStat("Coins");
  World.Coin.Transparency = 1;
  await wait(5);
  World.Coin.Transparency = 0;
});

// A platform that goes up and down forever.
onStart(async () => {
  while (true) {
    await World.Platform.tween({ position: [0, 10, 0], duration: 2 });
    await World.Platform.tween({ position: [0, 0, 0], duration: 2 });
  }
});

// Each player's own value, loaded when they join.
onPlayerAdded((player) => {
  player.vars.coins ??= player.load("coins", 0);
  player.print(`Welcome, ${player.name}!`);
});

// Local script (on a GUI button): `player` is you.
onClick(() => {
  player.gui.Label.Text = "Bought!";
  fireServer("buy", "sword");
});
  • Every script is nodes and code at once. In Studio, open a script and switch to </> Code: that's the same script, written as JavaScript. Edit it there and your changes become its nodes when you go back to ◇ Nodes (or press Apply). Lines with a node of their own (setting a part, adding to a stat, waiting, if, loops, functions...) become those nodes; anything else becomes a Code node, so nothing is lost.
  • It's real JavaScript (TypeScript types are fine too): functions, classes, lists, for, async/await. await wait(1) pauses just that code. Code outside any event goes in a Script top node and runs first.
  • Server scripts run the shared world on the game server. Local scripts run on each player's own computer, where player is that player: they change that player's GUI and sky, and talk to the server with fireServer / onClientEvent.
  • Pasting code into a script adds it as nodes the same way. Build something with nodes and look at </> Code to see how it's written.
  • A mistake gets a hint: World.Door.color = "red" says did you mean .Color?, and player.giveCoins(5) says try player.addStat("Coins", 5).
  • Code that runs too long without a wait() is stopped (and reported) so the game keeps going.
  • Ready-made scripts to start from: Templates.
  • Every function, with its types: gizlo.d.ts (TypeScript definitions; save it next to your code and editors use it for autocomplete).

The game API

Everything a script can use. Server scripts can use all of it except the Local section; Local scripts can use events, the GUI, the sky, values and timers.

Events

onStart(() => { … })
When the game starts (Server: when the first player joins; Local: when the player's game opens).
onTick((dt) => { … })
Every server tick, about 20 times a second; dt is the seconds since the last one.
onPlayerAdded((player) => { … })
A player joined. Also onPlayerRemoved (left) and onDied (died).
onTouch(World.Coin, (hit, player) => { … })
Something touched the part. hit is the body part's name, player whose body it is (undefined if it wasn't a player). onTouchEnded when it stops.
onRemoteEvent("buy", (data, player) => { … })
A player's Local script sent this event with fireServer.

Parts and the world

World.Door, World.Folder.Door, Storage.Coin, find("World.Folder.Door")
Parts and folders by name (World["My Part"] for names with spaces). Storage holds things to clone.
.Position .Size .Rotation
[x, y, z]; rotation in degrees.
.Color .Transparency .Collidable .Material
"red" or "#ff8800"; 0 (solid) to 1 (invisible); true / false; a material name.
.tween({ position, rotation, by, duration, easing, repeat })
Moves or turns it smoothly (players standing on it ride along). by: true moves by that much instead of to it. easing: Smooth, Linear, EaseIn, EaseOut, Bounce, Elastic. repeat: Once, Loop, PingPong. await it to wait until it's done. .stopTween() stops it.
.clone() .destroy() .children() .find(name) .parent .distanceTo(part) .exists()
Copy it into the World, remove it, what's inside it, the part inside with that name, the folder it's in, how far, whether it's still there.
World.TimeOfDay World.Weather
Hour (0–24); "None", "Rain", "Snow" or "Ash".
World.Sky.… World.Clouds.… World.Fog.…
Sky: SunSize, Glow, Haze, Preset, Eclipse, Lightning, Transition. Clouds: Enabled, Quality, Coverage, Density, Altitude, Thickness, WindSpeed, WindDirection, Detail, Brightness. Fog: Enabled, Color, Start, End.
isCharacter(hit)
Whether the hit from onTouch is part of a player's body.

Players

players() getPlayer("bob")
Everyone in the game; one player by name (or id).
player.name player.id player.position
Who they are and where.
player.health player.maxHealth player.walkSpeed player.jumpPower
Read or set.
player.vars.coins
That player's own value, kept between events; node scripts see the same one as the variable coins. A plain let at the top of a Server script is shared by everyone.
player.addStat("Coins", 1) player.setStat("Coins", 0) player.getStat("Coins")
Leaderboard stats.
player.save("coins", 10) player.load("coins", 0)
Saved for that player in this game, kept between visits (50 keys, 1000 characters each). load gives back the default's type.
player.teleport(World.Spawn) player.teleport([0, 5, 0]) player.setSpawnPoint(part)
Move them; where they come back after dying.
player.kill() player.damage(10) player.heal(10) player.respawn()
Kill, hurt, heal or respawn them.
player.send("hit", data) sendAll("hit", data)
Send an event to that player's (or everyone's) Local scripts: onClientEvent.
player.gui.Label
That player's GUI element, with .Text .Visible .Color .TextColor .BackgroundTransparency.

Local scripts

player
The player whose computer the script runs on (no need to get it from an event).
onClick(() => { … })
The GUI button this script is on was clicked.
onKeyPress("E", () => { … })
A key: a letter, a number, "Space", "Enter", "Shift", "Tab", "Up", "Down", "Left", "Right".
onClientEvent("hit", (data) => { … })
A Server script sent this event (player.send / sendAll).
fireServer("buy", "sword")
Send an event to the server (onRemoteEvent).
player.gui.Label.Text = "Hi" World.TimeOfDay = 20
Change this player's GUI and sky (just for them).

Time and values

await wait(1)
Pause this code for some seconds; everything else keeps going.
spawn(async () => { … })
Run something alongside without waiting for it.
print("Hi", x)
Write to the Output window.
random(1, 6) time()
A whole number from 1 to 6; seconds since the game started.
runNode("Kind", { settings }, "output")
Run any node from the list below by name; gives back what it writes to the setting you name.

Templates

Working scripts to start from. Copy one, then in Studio open a script (a Server script, or a Local script where it says so), switch to </> Code and paste it in (or use Paste in the node view): it becomes nodes you can change. Rename the parts in the code to match your game.

Collectible coin

A coin that gives 1 coin, hides, and comes back after 5 seconds.

// Server script. Put a part called Coin in the World.
onTouch(World.Coin, async (hit, player) => {
  if (!player || World.Coin.Transparency === 1) return;
  player.addStat("Coins", 1);
  World.Coin.Transparency = 1;
  World.Coin.Collidable = false;
  await wait(5);
  World.Coin.Transparency = 0;
  World.Coin.Collidable = true;
});

Deadly lava

Touching the lava kills the player.

// Server script. Put a part called Lava in the World.
onTouch(World.Lava, (hit, player) => {
  if (player) player.kill();
});

Moving platform

Goes up and down forever; players ride along.

// Server script. Put a part called Platform in the World.
onStart(() => {
  // up 10 and back down, forever (players standing on it ride along)
  World.Platform.tween({ position: [0, 10, 0], by: true, duration: 3, repeat: "PingPong" });
});

Spinning part

Turns all the way round every 4 seconds.

// Server script. Put a part called Fan in the World.
onStart(() => {
  World.Fan.tween({ rotation: [0, 360, 0], by: true, duration: 4, easing: "Linear", repeat: "Loop" });
});

Door with a button

Step on the button: the door slides up, waits, and closes again.

// Server script. Put parts called Door and DoorButton in the World.
let open = false;

onTouch(World.DoorButton, async (hit, player) => {
  if (!player || open) return;
  open = true;
  World.DoorButton.Color = "green";
  await World.Door.tween({ position: [0, 8, 0], by: true, duration: 1 });
  await wait(3);
  await World.Door.tween({ position: [0, -8, 0], by: true, duration: 1 });
  World.DoorButton.Color = "red";
  open = false;
});

Checkpoint

Players come back here after dying. No script needed for that: in Studio, click + next to World, pick Insert Spawn Point, and tick Checkpoint in its properties. It's the spawn point itself that counts, not its name, so rename it freely. This script only turns it green so players can see they reached it.

// Server script. A Spawn Point with Checkpoint ticked does the
// respawning by itself; this only shows players they reached it.
onTouch(World.SpawnPoint, (hit, player) => {
  if (player) World.SpawnPoint.Color = "green";
});

Coins that save

Coins on the leaderboard that are still there next visit.

// Server script. Coins show on the leaderboard,
// and they're still there next time the player visits.
onPlayerAdded((player) => {
  player.setStat("Coins", player.load("coins", 0));
});

// Call this whenever a player's coins change.
async function giveCoins(player, amount) {
  player.addStat("Coins", amount);
  player.save("coins", player.getStat("Coins"));
}

onTouch(World.Coin, async (hit, player) => {
  if (player) await giveCoins(player, 1);
});

Day and night

The sun goes round: a full day every 4 minutes.

// Server script: a full day every 4 minutes.
onStart(async () => {
  while (true) {
    World.TimeOfDay = (World.TimeOfDay + 0.1) % 24;
    await wait(1);
  }
});

Shop button

A Local script on a button asks the server; the server checks the coins and answers.

// Local script on a TextButton. Add a TextLabel called ShopLabel too.
onClick(() => {
  fireServer("buy", "speed");
});

onClientEvent("shop", (message) => {
  player.gui.ShopLabel.Text = message;
});
// Server script: the shop.
onRemoteEvent("buy", (item, player) => {
  if (item !== "speed") return;
  if (player.getStat("Coins") < 10) {
    player.send("shop", "You need 10 coins");
    return;
  }
  player.addStat("Coins", -10);
  player.walkSpeed = 24;
  player.send("shop", "Bought speed!");
});

Round timer

The server counts down; every player's screen shows it.

// Server script: a 30 second round, over and over.
onStart(async () => {
  while (true) {
    for (let t = 30; t > 0; t--) {
      sendAll("timer", t);
      await wait(1);
    }
    sendAll("timer", "Round over!");
    await wait(5);
  }
});
// Local script. Add a TextLabel called TimerLabel.
onClientEvent("timer", (t) => {
  player.gui.TimerLabel.Text = typeof t === "number" ? `Time left: ${t}` : t;
});

Sprint key

Tap Shift for 3 seconds of speed (the Local script asks, the Server script does it).

// Local script: press Shift to sprint.
onKeyPress("Shift", () => {
  fireServer("sprint");
});
// Server script: sprint for 3 seconds.
onRemoteEvent("sprint", async (data, player) => {
  player.walkSpeed = 30;
  await wait(3);
  player.walkSpeed = 16;
});
Writing scripts as text
# Gizlo script v1
script Server
var coins: Number = 0

OnTouch part:Coin output:otherPart
  IsCharacter object:otherPart result:isChar
  If var:isChar op:== value:true
    true:
      AddToPlayerStat stat:Coins amount:1
      DestroyObject object:World.Coin
  • In Studio's script editor, Copy Script as Text gives you this, and Paste Script from Text turns it back into nodes.
  • A line at the left edge starts a chain. What it runs goes underneath, indented two spaces, one node per line.
  • Settings are key:value. Use quotes for spaces: value:"hi there". $name reads a variable.
  • If / Repeat / ForEach: put each path under true: / false: (or loop: / done:).
  • then: starts a second chain from the same node. label name and goto name wire back to an earlier node.
  • var name: Number = 0 declares a variable (add global to share it). Lines starting with # are notes.

Events

OnStartServer + LocalStarts a chain
Runs once when the game starts (Server: when the first player joins; Local: when that player's game opens).
OnStart
onStart(() => { ... });
OnTouchServerStarts a chain
Runs when a player touches the part. The player who touched it becomes the one running the chain.
OnTouch output:otherPart
onTouch(World.Coin, (otherPart) => { ... });
Partpartpart · this script's part
Varoutputvariable name
OnTouchEndedServerStarts a chain
Runs when a player stops touching the part.
OnTouchEnded output:otherPart
onTouchEnded(World.Pad, (otherPart) => { ... });
Partpartpart · this script's part
Varoutputvariable name
OnKeyPressLocalStarts a chain
Runs when this player presses a key: a letter, a number, Space, Enter, Shift, Tab or an arrow (Up, Down, Left, Right).
OnKeyPress key:E
onKeyPress("E", () => { ... });
Keykeykey · default E · E, 1, Space, Up...
OnPlayerAddedServerStarts a chain
Runs when a player joins. Their name goes in the output variable, and they run the chain.
OnPlayerAdded output:player
onPlayerAdded((player) => { ... });
Varoutputvariable name
OnPlayerRemovedServerStarts a chain
Runs when a player leaves. Their name goes in the output variable.
OnPlayerRemoved output:player
onPlayerRemoved((player) => { ... });
Varoutputvariable name
OnDiedServerStarts a chain
Runs when a player dies. Their name goes in the output variable.
OnDied output:player
onDied((player) => { ... });
Varoutputvariable name
OnClickLocalStarts a chain
Runs when the player clicks the GUI button this Local script is attached to.
OnClick
onClick(() => { ... });
OnRemoteEventServerStarts a chain
Runs when a player's Local script fires this event with FireServer.
OnRemoteEvent output:data player_output:player
onRemoteEvent("buy", (data, player) => { ... });
Eventeventevent name
Dataoutputvariable name
Playerplayer_outputvariable name
OnClientEventLocalStarts a chain
Runs when a Server script sends this event to the player with FireClient.
OnClientEvent output:data
onClientEvent("hit", (data) => { ... });
Eventeventevent name
Dataoutputvariable name

Flow

WaitServer + LocalWaits
Waits this many seconds, then carries on.
Wait duration:1
await wait(1);
Secsdurationnumber · default 1 · seconds
IfServer + LocalPaths: true / false
Compares a variable with a value and goes down the true or false path.
If var:myVar op:== value:0
if (myVar == 0) { ... } else { ... }
Varvarvariable name · default myVar
Opop== != > < >= <=
Valuevalueany value · default 0
RepeatServer + LocalPaths: loop / done
Runs the loop path this many times (up to 1000), then the done path.
Repeat count:3 index:i
for (let i = 1; i <= 3; i++) { ... }
Timescountnumber · default 3
Countindexvariable name
ForEachServer + LocalPaths: loop / done
Runs the loop path once for each item in a list (like GetChildren's), then the done path.
ForEach list:children item:item
for (const item of children) { ... }
Listlistvariable name · default children · list variable
Itemitemvariable name
WhileServer + LocalPaths: loop / done
Runs the loop path again and again while the test is true, then the done path. Put a Wait inside.
While var:myVar op:== value:0
while (n < 10) { ... }
Varvarvariable name · default myVar · or =code
Opop== != > < >= <=
Valuevalueany value · default 0

Actions

SetObjectPropertyServer + Local
Changes a property of a part (Position, Size, Rotation, Color, Transparency, Collidable, Material), a GUI element, the World, or the player's Humanoid.
SetObjectProperty object:World.Part property:Color value_type:String val_x:0 val_y:0 val_z:0
World.Door.Color = "red";
Objobjectpart or folder · World.Part
Proppropertytext · default Color
Valuevalueany value
Typevalue_typeString Number Bool Vector3
Xval_xnumber · default 0
Yval_ynumber · default 0
Zval_znumber · default 0
GetObjectPropertyServer + Local
Reads a property of a part, GUI element or the World into a variable.
GetObjectProperty object:World.Part property:Position variable:value
const pos = World.Door.Position;
Objobjectpart or folder · World.Part
Proppropertytext · default Position
Varvariablevariable name
GetParentServer
Puts the path of the folder an object is in into a variable.
GetParent result:parent
const parent = World.Door.parent;
Objobjectpart or folder
Varresultvariable name
IsCharacterServer
Sets a variable to true if the object is part of a player's character.
IsCharacter result:isChar
const isChar = isCharacter(otherPart);
Objobjectpart or folder · e.g. $otherPart
Varresultvariable name
KillPlayerServer
Sets a player's health to 0.
KillPlayer
player.kill();
Playerplayerplayer · (you) / all / $var
DamagePlayerServer
Takes health away from a player.
DamagePlayer amount:10
player.damage(10);
Playerplayerplayer · (you) / all / $var
Amountamountnumber · default 10
HealPlayerServer
Gives a player health back (up to their max).
HealPlayer amount:10
player.heal(10);
Playerplayerplayer · (you) / all / $var
Amountamountnumber · default 10
PrintServer + Local
Writes a message to the Output window (handy for testing).
Print
print("Hello!");
Textvalueany value
FireServerLocal
Sends an event (and some data) from this player's Local script to the server.
FireServer
fireServer("buy", "sword");
Eventeventevent name
Datadatatext
FireClientServer
Sends an event (and some data) from the server to a player's Local scripts. Empty player = everyone.
FireClient
sendAll("hit", "5"); // or player.send("hit", "5")
Playerplayerplayer · empty / all = everyone
Eventeventevent name
Datadatatext

PlayerStats

GetPlayerStatServer
Reads one of the player's leaderboard stats into a variable.
GetPlayerStat stat:Coins result:value
const coins = player.getStat("Coins");
Statstattext · Coins
Varresultvariable name
SetPlayerStatServer
Sets one of the player's leaderboard stats (whole numbers).
SetPlayerStat stat:Coins value:0
player.setStat("Coins", 0);
Statstattext · Coins
Valuevaluenumber · default 0
AddToPlayerStatServer
Adds to (or, with a negative amount, takes from) one of the player's leaderboard stats.
AddToPlayerStat stat:Coins amount:1
player.addStat("Coins", 1);
Statstattext · Coins
Amountamountnumber · default 1

Values

VariableServer + Local
Sets a variable to a value (or to another variable).
Variable value:0 value_type:Number val_x:0 val_y:0 val_z:0 name:myVar
myVar = 0;
Valuevalueany value · default 0
Typevalue_typeNumber String Bool Vector3
Xval_xnumber · default 0
Yval_ynumber · default 0
Zval_znumber · default 0
Varnamevariable name
ConvertServer + Local
Turns a value from one type into another (number, text, bool, vector3).
Convert from:Number to:String result:myVar
let myVar = convert();
Valvalueany value
FromfromNumber String Bool Vector3
TotoString Number Bool Vector3
Varresultvariable name
RandomNumberServer + Local
Picks a random whole number between min and max (both included).
RandomNumber min:0 max:100 variable:random
let random = randomNumber({ min: 0, max: 100 });
Minminnumber · default 0
Maxmaxnumber · default 100
Varvariablevariable name
GetDistanceServer
Measures the distance between two objects.
GetDistance result:distance
const distance = World.A.distanceTo(World.B);
Aobject_apart or folder
Bobject_bpart or folder
Varresultvariable name
ConstructVector3Server + Local
Builds an "x, y, z" value from three numbers.
ConstructVector3 x:0 y:0 z:0 result:myVec
let myVec = constructVector3({ x: 0, y: 0, z: 0 });
Xxnumber · default 0
Yynumber · default 0
Zznumber · default 0
Varresultvariable name
SplitVector3Server + Local
Splits an "x, y, z" value into three number variables.
SplitVector3 x_result:x y_result:y z_result:z
const [x, y, z] = pos;
Vecvecx, y, z
Xx_resultvariable name
Yy_resultvariable name
Zz_resultvariable name

Math

AddServer + Local
A + B into a variable.
Add a:0 b:0 result:result
result = a + b;
Aanumber · default 0
Bbnumber · default 0
Varresultvariable name
SubtractServer + Local
A − B into a variable.
Subtract a:0 b:0 result:result
result = a - b;
Aanumber · default 0
Bbnumber · default 0
Varresultvariable name
MultiplyServer + Local
A × B into a variable.
Multiply a:0 b:0 result:result
result = a * b;
Aanumber · default 0
Bbnumber · default 0
Varresultvariable name
DivideServer + Local
A ÷ B into a variable (dividing by 0 leaves the variable as it was).
Divide a:0 b:0 result:result
result = a / b;
Aanumber · default 0
Bbnumber · default 0
Varresultvariable name
JoinServer + Local
Sticks two pieces of text together into a variable.
Join result:text
text = a + " " + b;
Aatext
Bbtext
Varresultvariable name

Logic

AndServer + Local
True if both variables are true.
And result:result
result = a && b;
Avar_avariable name
Bvar_bvariable name
Varresultvariable name
OrServer + Local
True if either variable is true.
Or result:result
result = a || b;
Avar_avariable name
Bvar_bvariable name
Varresultvariable name
NotServer + Local
Flips true to false and false to true.
Not result:result
result = !a;
Varvarvariable name
Varresultvariable name

Objects

CloneObjectServer
Copies a part or folder (from Storage or the World) into the World.
CloneObject source:Storage.Coin parent:World result:cloned
let cloned = cloneObject({ source: Storage.Coin });
Srcsourcepart or folder · Storage.Coin
Parparentpart or folder · default World · not used yet
Varresultvariable name
DestroyObjectServer
Deletes a part or folder from the World.
DestroyObject object:World.Part_1
destroyObject({ object: World.Part_1 });
Pathobjectpart or folder · World.Part_1
GetChildrenServer
Puts a list of everything inside a folder into a variable (use it with ForEach).
GetChildren object:World.Folder result:children
let children = getChildren({ object: World.Folder });
Objobjectpart or folder · World.Folder
Varresultlist
FindFirstChildServer
Looks inside a folder for something with this name; the variable gets its path, or stays empty.
FindFirstChild object:World.Folder result:found
const found = World.Folder.find("Door");
Objobjectpart or folder · World.Folder
Namenametext
Varresultvariable name

Movement

TweenObjectServer
Moves or rotates a part smoothly over time. Players standing on it ride along.
TweenObject object:World.Platform property:Position mode:To target:0,10,0 duration:2 easing:Smooth repeat:Once wait:false
tweenObject({ object: World.Platform, target: [0, 10, 0], duration: 2 });
Partobjectpart · World.Platform
ProppropertyPosition Rotation
ModemodeTo By
XYZtargetx, y, z · default 0,10,0 · x, y, z (rotation in degrees)
Secsdurationnumber · default 2 · seconds
EaseeasingSmooth Linear EaseIn EaseOut Bounce Elastic
PlayrepeatOnce Loop PingPong
Waitwaitfalse true
StopTweenServer
Stops a part's movement where it is.
StopTween object:World.Platform property:All
stopTween({ object: World.Platform });
Partobjectpart · World.Platform
ProppropertyAll Position Rotation

Player

TeleportPlayerServer
Moves a player to a position or onto the top of a part.
TeleportPlayer to:Position position:0,10,0 part:World.Checkpoint
teleportPlayer({ position: [0, 10, 0], part: World.Checkpoint });
Playerplayerplayer · (you) / all / $var
TotoPosition Part
XYZpositionx, y, z · default 0,10,0
Partpartpart · World.Checkpoint
SetWalkSpeedServer
Sets how fast a player walks (normal is 6, max 100, 0 freezes them).
SetWalkSpeed speed:16
setWalkSpeed({ speed: 16 });
Playerplayerplayer · (you) / all / $var
Speedspeednumber · default 16 · normal is 6
SetJumpPowerServer
Sets how high a player jumps (normal is 10, max 200).
SetJumpPower power:15
setJumpPower({ power: 15 });
Playerplayerplayer · (you) / all / $var
Powerpowernumber · default 15 · normal is 10
RespawnPlayerServer
Sends a player back to their spawn point with full health.
RespawnPlayer
respawnPlayer();
Playerplayerplayer · (you) / all / $var
SetSpawnPointServer
Gives a player their own spawn point on top of a part (a checkpoint). Leave the part empty to go back to normal.
SetSpawnPoint
setSpawnPoint();
Playerplayerplayer · (you) / all / $var
Partpartpart · empty = normal spawn

Saved Data

SaveDataServer
Saves a value for a player in this game, kept between visits (50 keys per player, 1000 characters each; empty value deletes).
SaveData key:coins
player.save("coins", coins);
Playerplayerplayer · (you) / all / $var
Keykeytext · default coins · name
Valuevaluetext · text or $var
LoadDataServer
Loads a value a player saved in this game into a variable (or the default if they never saved it).
LoadData key:coins default:0 result:loaded
const coins = player.load("coins", 0);
Playerplayerplayer · (you) / all / $var
Keykeytext · default coins · name
Elsedefaulttext · default 0 · if never saved
Varresultvariable name

Functions

ScriptTopServer + LocalStarts a chain
Runs first, when the script loads (before any event). Code here can make values and functions the rest of the script uses.
ScriptTop
const SPEED = 5; // code outside any event
FunctionServer + LocalStarts a chain
A function: the nodes wired after it run when a Call node calls it. Its inputs are variables inside it ($name).
Function name:myFunction
async function giveCoins(player, amount) { ... }
Namenametext · default myFunction
Takesparamstext · amount, part
CallServer + Local
Runs a function and waits for it to finish. What it gives back goes in the variable.
Call name:myFunction
const result = await giveCoins(player, 5);
Funcnametext · default myFunction
Withargstext · 5, $part
Varresultvariable name
ReturnServer + Local
Stops here; in a function, gives back a value to the Call node.
Return
return total;
Givevalueany value · $total
CodeServer + Local
Runs JavaScript you write. $name reads or sets a variable.
Code
// any JavaScript; $name is a variable
codetext
This list comes from the game server's node registry (it's refreshed from the server when this page loads). View as JSON · Type definitions (gizlo.d.ts)