Nubness Custom Monster AI script (Error)

06/03/2017 17:56 Dotzie#1
Hello Epvpers

Once again im here for my test server, I tryed out the Custom Monster AI release from Nubness. However of some dumb reason i cant get it too work, been scratching my head for hrs without success...

this is my error in the logs about the new .Lua.

.\Data\Lua\119.lua:61: attempt to compare number with nil

And it wont do the stuff i tell it too do. this is the lua it self:

Code:
 -- //////////////////////////////////////////////////////////////////////
-- 카일룸 사크라 보스 1차 보스 몬스터_ID-2821 AI 119.Lua  ver.090513
-- //////////////////////////////////////////////////////////////////////



-- //////////////////////////////////////////////////////////////////////

Mob = LuaMob(CMob)

-- //////////////////////////////////////////////////////////////////
-- 사용자 변수는 여기에 선언합니다.


-- //////////////////////////////////////////////////////////////////
-- 사용자 함수는 여기에 선언합니다.



-- //////////////////////////////////////////////////////////////////
function Init()

end

-- //////////////////////////////////////////////////////////////////
function OnAttacked( dwTime, dwCharID )

end

-- //////////////////////////////////////////////////////////////////
function OnAttackable( dwTime, dwCharID )

end

-- //////////////////////////////////////////////////////////////////
function OnNormalReset( dwTime )


end

-- //////////////////////////////////////////////////////////////////
function OnDeath( dwTime, dwAttackedCount )

		Mob:LuaCreateMob( 2470,1,0.0,0.0 )
end

-- //////////////////////////////////////////////////////////////////
function OnReturnHome( dwTime, dwAttackedCount )

end

-- //////////////////////////////////////////////////////////////////
function OnMoveEnd( dwTime )

end


-- //////////////////////////////////////////////////////////////////
function WhileCombat( dwTime, dwHPPercent, dwAttackedCount )
end
if ( dwHPPercent >= 95 ) then
if ( bMobSay < 1) then
Mob:LuaSayByIndex ( 10130, 200.0 )
bMobSay = bMobSay + 1
end
end
if ( dwHPPercent <= 75 ) then
if ( bMobSay < 2) then
Mob:LuaSayByIndex ( 10130, 200.0 )
bMobSay = bMobSay + 1
end
Mob:LuaCreateMob ( 2803, 1, 0.0, 0.0 )
end
Thanks for the help!
06/03/2017 18:40 nubness#2
You forgot to declare the variables.

Quote:
Originally Posted by nubness View Post
These 3 lines represent the initialization of 3 variables:
Code:
dwNextCreateTime = 0
bMobSay	= 0
bMobCreate = 0
06/04/2017 12:03 Dotzie#3
Still gets the same error even after that.

If i remove the "end" at the beginning that closes the function it gives me an error of end missing too close it.

its giving me a headache lol
06/04/2017 12:22 nubness#4
Just read one of the default scripts and try to follow the pattern.
06/04/2017 13:29 Grim.#5
Quote:
Originally Posted by Dotzie View Post
Still gets the same error even after that.

If i remove the "end" at the beginning that closes the function it gives me an error of end missing too close it.

its giving me a headache lol
That's because you don't need to remove it, you have to move it to the end. Don't forget to indent your code in the future to make it easier to read and find mistakes.
06/04/2017 14:11 Dotzie#6
Using the Dios Exile script and removing parts off it i got it too work.
however if i wish too make it spawn mobs by time like

starts at 10% hp and down to 0%? is there a simple way too do it or do i have too add a whole script per 1% hp?