There is a bug in the script editor that causes scripts to collapse wrong. It also causes automatic incorrect tabbing of closing statements. This only seems to happen with functions containing elseif statements, single if statements and statements containing else, do not seem effected. This issue does not effect running the game, the scripts run as normal.
I noticed this bug today, but I hadn’t used the script editor since Thursday.
In this image the entire function should be collapsed:
Collapsing the first If statement also collapses the final end:
Creating a new line at the end of the script tabs the last end over automatically:
Repro:
Open a new world and insert a server script.
Create a simple function with an if statement containing elseif like the one shown in images