Microcontroller
Runs limited Roblox luau code in an environment called "pilot.lua". Triggering it with a polysillicon will either start, stop, or restart (FlipFlop mode) your code. You can also click it to turn it on/off.
Microcontrollers consume power depending on the amount of CPU time you use, which is the number of milliseconds your code spends doing stuff. Pauses and waits don't count towards your CPU time since they allow the game to continue on to go do other work. One CPU unit costs 1 units of power. If you don't have enough power your Microcontroller will pause.
Your code has a CPU limit, it can only spend up to 100 milliseconds every game tick. If you go over this limit it will pause until the next game tick.
You can press F9 to view WoS's client-side output. Any logs or errors from your Microcontrollers will appear there.
If you want to know about various globals you can use from Roblox's engine, you can take a look at Roblox's Developer Documentation and search for Roblox Globals and Lua Globals. For more info, check the game's wiki, or look at one of the game's social platforms if it's linked at the bottom of the game page.
It is a craftable and spawnable non-flammable solid.
Here is a list of possible sizes that reach the maximum malleability (100) that have integer components: 1x100x1, 1x50x2, 1x25x4, 1x20x5, 1x10x10, 2x25x2, 2x10x5, 4x5x5, 10x5x2
At its default size (3x0.50x2) it has a durability of 1, at its maximum size it has a durability of 4.
By default, its colour is #2c651d.
It requires 5 Copper
, 5 Iron
, 5 Quartz
, and 5 Silicon
to be crafted.
Methods
Receive() → (sender, ...)
Waits for data to be received.
The returns for Receive
are as follows:
- The sender return is the microcontroller sending the data. It is a
Microcontroller
. - The variadic return is the parameters sent through by the other microcontroller. It can be anything.
Send(...)
Sends the data you provide to a remote microcontroller. Parts you pass will be based on your microcontroller's context.
The variadic parameter is the parameters to send to the other microcontroller. It can be anything.
Shutdown()
Kills the microcontroller.
Configurables
Code
The code to be executed on this microcontroller. It is a string
.
StartOnSpawn
Whether or not to start the Microcontroller when it spawns. It is a boolean
.
Events
Loop(deltaTime)
Fires when the object is updated by the game loop.
The deltaTime parameter is the 'time' since the last tick, it does not represent the actual time since the last tick was occurred, rather just how often a game tick should be fired (it will always be precisely 1
). It is a number
.
OnClick(clickerId)
Fires when the object is clicked.
The clickerId parameter is the UserId
of the player who clicked the object. It is a number
.