BraK's Explaination 
So we have a script we made. let's say something like this:
Code:
program WalktoThere;
Begin
WhereAreWe;
If Location = Destination then
exit;
Walk1;
Walk2;
Walk3;
WhereAreWe;
If Location = Destination then
begin
result := true;
Exit;
end;
SayWeAreLost;
TerminateScript;
end.
Now let's say a bunch of users are saying that the script just stop randomly when walking. How would you know where the script got lost? For this we use Debugs. In each step of the script you add a debug saying what it is doing on not doing.
Code:
program WalktoThere;
Begin
WhereAreWe;
DebugLn('Current Location := ' + Location);
if Location = Destination then
begin
DebugLn('We are at the Destination exiting WalkToThere procedure.');
result := true;
exit;
end;
DebugLn('Doing Walk1 Procedure.');
Walk1;
DebugLn('Doing Walk2 Procedure.');
Walk2;
DebugLn('Doing Walk3 Procedure.');
Walk3;
WhereAreWe;
DebugLn('Current Location := ' + Location);
If Location = Destination then
begin
DebugLn('We are at the Destination exiting WalkToThere procedure.');
result := true;
Exit;
end;
DebugLn('We Are Lost Terminating Script'); TerminateScript;
end.
As seen above I added in a few Debugs. These debugs will let us know at what point the script stop working and what it was doing. So instead of the scripter having to recreate the error or guess at where the problem is in the script we already have an exact location of the Error. Why is this important? It saves tons of time when fixing broken Scripts. Instead of reworking a whole series of events we can just work on the broken portion of it.
Hopefully you can understand the Examples I gave. None of the Examples are actual working code they are ment to be just that examples.