Mistakes when you code broadly fall into three categories.
Syntax / Static Errors
These are errors that prevent the computer from understanding what your script means; for example, forgetting an end or misspelling tehn; not having ( or ) balanced right; using an invalid name or number like person 2 or 2person
Since the computer gets confused, it just stops when it finds the mistake and does no more work.
Crashes / Runtime Errors
These are errors that happen when you try to do something that doesn't make sense, for example "cat" + "dog" doesn't make sense and Lua will error, complaining that you can't add strings.
The computer can't[^1] predict that these will happen, so it will execute your script until that problem happens.
[^1]: It can't always. Some tools / programming languages are better at catching these problems ahead-of-time; Lua doesn't, though ROBLOX's Script Analysis will help you catch some of them!
"Logic Errors"
This occurs when you program doesn't have any static errors, and doesn't crash, but doesn't do what you intended.
In other words, you wrote a valid program, but you didn't write the program you intended.
The computer can't possibly know your intent (beyond the program that you've given it) so if you make a typo that still ends up being a valid program, it will still run it.
What to do
Script Analysis can help catch some of those mistakes.
In general, it's better for errors to happen sooner; you'd prefer a syntax error over a crash; you'd prefer a crash over the program silently doing the wrong thing.
Defensive coding styles will make it more likely that errors happen sooner; as you get more practice you'll learn some through trial, error, and reading.
3 comments
In this case, no, it can not, as this has something to do w/ a function; however, for outside things, such as properties that may not be valid for certain objects, you can use the pcall function: http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#pcall
Ah I see, Thanks
Np. :)