What is a block script?
Have you ever noticed that the characters’ heads in Free Fire become very big?
This effect is achieved using a powerful block script.
Block script is a visual programming method that allows you to write highly customized game logic.
Entry point
You can find the entry point to block script under the More menu.

There are also some other locations where you can enter the block script editing interface. You can find the entry for block scripts under Basic Settings and Property Settings in Edit Gameplay Rules . The editing interface they enter is the same.
Basic introduction to blocks
Editor
First, we can see the important areas in the block editor.

On the left there are all the available blocks in different categories. In the center is the editing scene we call the “canvas”. Blocks need to be dragged and dropped into the canvas to take effect.
Block categories
There are two core categories of blocks:
- Events, which determine when logic is triggered, e.g. whenever a player joins the game, or when the start of a round. The currently available events for the script are in the red block category
- Actions, which are instructions to the game. In our case, we need an action to make the character’s head bigger! You can find the vast majority of actions in the green and blue block categories.
Using blocks
From the left, hold down the block and drag it into the canvas to use it in the current script.


Blocks can be connected to each other.


Manipulating blocks
Selecting
Clicking on a block will select it, and a block operation panel will appear directly below the canvas, with the selected block highlighted.

Delete
Click to delete. This will delete the selected block from the group of blocks, and the blocks below will automatically fill upwards.

You can also drag connected blocks into the right side to delete it.


Undo and redo
Worried about making a mistake? The shortcut menu on the right allows you to undo or redo all changes to the block script:

Block data
As you may have noticed, there are various colored blocks and plus signs on the blocks. This indicates the data that the block can provide for the block below it and the data it needs.
Some of the required data has already been filled in with a default value for you, such as “Auto Play” in the image above
Each block has its own unique logic, and the data provided and the data required are of different data types. Sometimes, we have to use data blocks, variables, and even functions to provide and receive data. After all is said and done, a game is just a bunch of data calculations.
Make Player’s head bigger
Now that you know how to manipulate blocks, let’s follow along and make the character’s head bigger in your map!
All we need to do is complete the block script like this:
Don’t let the length scare you, the core is just to set the zoom of the header to three times the default size.
First, let’s prepare the blocks we need:

Adjusting the head zoom is a bit more complicated, because you cannot get the zoom of the player’s head directly from the player properties. So we need Get property block to help us get properties that cannot be read directly from Set property block .
We use Get property to get the player’s rig:
The target entity of Get property is dragged down from On Player Join, which means: Whenever a player joins the game, get the properties of the player who has joined the game.
Use the obtained rig as the target entity and continue to get the “head”
Drag the “head” you obtained above into Set property, and select the property “Skeleton Scale”:
Click the plus sign next to Value and select the Vector3 assignment block from the left.

Fill in X, Y, and Z with 3.
Vector3 is a data type consisting of three numbers. Here, the default scale of the rig is (1,1,1). Filling in (3,3,3) means that the head is enlarged three times in all three dimensions of 3D space. You can also try filling in different combinations of numbers to see the actual performance.
Finally, let’s connect the Set Property block to the On Player Join block. Only connected blocks make the logic work.

Click on the debug button to enter the game and see how it performs:


There are even more powerful functions in the block script waiting to be discovered by you.
Different scripts
The same block may behave differently in different scripts!
This is because, in addition to the “global script” we just used, each player will have a “player script” and each team will have a “team script”. If you wish, you can even add scripts to objects and consumables in the Scene.
Scripts take effect on the entity they are on. If an event such as “On Player Join” is placed on the “player script”, then every player on the field (including the new player) will respond to this event whenever a player joins. If our block is to give the player an M4A1 when he joins, if it is placed in the global script, then each player will have one M4A1; if it is placed in the player script, each player will give the new player an M4A1, and the new player will have too many guns to handle!