Hey guys,
I recently started creating new starting areas and need training dummies that do the exact same thing as if you change a npc's value to Dummy in the db on Arcemu, but are killable. The script was intended to make it so the npc can't target the player, can't move or attack, but can die. I have googled it for those with that smart remark and there several people that have wanted this, non of them have ever gotten an answer than worked. As far as I know scripting ( Not much since I never bothered to waste my life on a fake computer language.) is that the values in this script should work, though they don't.
The script is:
function trainingDummy_Root(pUnit, event)
Unit:Root()
Unit:SetCombatCapable(0)
end
function trainingDummy_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
function trainingDummy_OnKilledTarget(Unit, Event)
end
function trainingDummy_OnDied(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(1921, 1, "trainingDummy_Root")
RegisterUnitEvent(1921, 2, "trainingDummy_OnLeaveCombat")
RegisterUnitEvent(1921, 3, "trainingDummy_OnKilledTarget")
RegisterUnitEvent(1921, 4, "trainingDummy_OnDied")
Note: I really don't like people giving me lessons on lua, I ain't going to waste my time on it, so if there's not a working script, no rep. Just saying in the past all i have been getting from people is tips on how to fix the script, just rewrite it and let me move on with my life, I could give a big rat's ass about lua scripting. Just give me the script, you get rep, everyone is happy.
My other question is, is there an exisiting program that tests if a lua has a problem in it and (optional) fixes it if it does. Only needs to check as apparently my server got corrupted by starting up errored files and it caused this massive problem so I don't want to see anymore if a script is good or not in World.exe. I'm running a large project and can't afford risks like that everything I think a lua is bad, and it starts up with an error it has a chance to corrupt my server files.