What does adding Semi Colons at the end of a line mean?

I’ve seen some scripters add Semi Colons at the end of a line, and it wasn’t in a table or anything, just a line like the following example (real example):

function AllowForceTie(ToolHumanoid)
	if ForceTie.Value == false then 
		return(ToolHumanoid.Health > 0);
	else return true;
	end;
end;

Thanks in advance!

2 Likes

The example code you provided wouldn’t differ in functionality if it were to be omitted. If I recall correctly, it doesn’t do anything in Luau under this context – it might just be a habit from other coding languages.

1 Like

Alright gotchu, thank you very much for responding!

1 Like

Javascript uses semicolons, and I’m assuming that when people use it in Lua (even though you don’t have to) it’s when they write code like this:

local yep = 1;local E = 2;local epic = 5;
print(yep);print(E);print(epic);
1 Like

The C# language also uses semi colons.

1 Like

The semicolon is used to separate different statements in Lua. You’ll see it quite often in other languages but since it’s optional in Lua you’ll only find it in cases of ambiguity.

3 Likes