Usually it is just purely cosmetic. Some people might use it in Roblox Lua because they got used to using semicolons at the end of lines of code. Some programming languages like C++ need semicolon at the end of every command and some programmers could move this habbit to Roblox Lua.
const a = 100;
var b = 10;
let c = 1;
parseInt("102");
Its just there to determine where the line/statement ends, and afaik in lua, it can also be used in tables to define an index (pretty sure other languages do that, but idk):
{
a = 1;
b = 2;
-- and so on
}
As far as I was told, in most languages, they dont use it the same way as other languages, in which some of them use a semicolon to define the end of a statement.
Otherwise it just mostly acts as a thing you use to easily read your code.
I dont think Lua is one of those languages, but my habits still kick in from JavaScript:
local this = true;
local that = 281902;
thisFunction();
As far as im concerned for lua, it’s a preference, but there is a few things It can be used for, like I mentioned:
But that can just as easily be replaced with a regular comma.
I only ever use it to define an end statement like I have for outside languages, its just easier for me to understand and read, but I can’t say the same for everyone else.
Languages like Lua and Python are identation based, and because they’re high level languages, they do not require “;” generally. (Though in some cases the VM/Type checker may require you to use it)