Hai!
Today, I'm going to teach you to troubleshoot LUA, because I see too many threads asking help with LUA just because they can't find the error themselves (Happened to me before, I'm just trying to reduce the amount of help threads.)
Step 1. Locate the error
When you are trying to start the Ascent with script, if it displays error, it will display the error message. I am not absolutely sure what it is, but it will tell you something about line number. Get that number down, because that is the line in which you have the error.
Step 2. Finding the error in script
If you are using Notepad, this is little harder, because it does not display numbers. Notepad ++, for example, does, which makes the process alot easier.
If using notepad, you need to count the lines. If using other with numbered lines, just scroll down to the error line.
Step 3. Fixing the error
To fix the error you should check the whole function. Here is a good example of broken script.
Try locating the error yourself now. Once you have, take a look to the following code box. (If you don't you're just cheating yourself, not anyone else.)Code:function test_phase1(pUnit, Event) if pUnit:GetHealthPct() < 50 then pUnit:FullCastSpell(ID) Unit:RegisterEvent("test_phase2", 1000, 0) end end function test_phase2(pUnit, Event) And so on..
So we have to change it. If you would now fix it, it should work perfectly.Code:The error is in Unit:RegisterEvent function. We have been using pUnit instead of Unit, so using Unit wont work. You can't change it.
In larger and more complicated scripts finding errors might be harder, because you might be declaring lots of different functions, and calling for them in other functions. If people like this, I might make advanced error detecting guide ^_^
That's it for today! You have learned to successfully find and fix the error.