dami1310
◄ Unidentified ►
I just started learning lua so I don't know a lot of things and I tried to write script basing on created one, but something goes wrong and it isn't working.
Here's error screen:
I hope you can do something with it ; /
Code:
function onAdvance(cid)
local voc = getPlayerVocation(cid)
local transform = transforms[voc]
local text1 = "..."
if(not transform) then
doPlayerSendCancel(cid, text1)
return true
end
transforms =
{
[1] = {outfit = {lookType = 7, lookTypeEx = 0, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}, text = "Moete kita zo!", textSayType = TALKTYPE_MONSTER, level = 10, gainMana = 1000, gainHealth = 1000, newVocation = 5, effect = 69},
}
if getPlayerLevel(cid) >= transform.level then
doPlayerSetVocation(cid, transform.newVocation)
doCreatureChangeOutfit(cid, transform.outfit)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + transform.gainMana)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + transform.gainHealth)
doSendMagicEffect(cid, transform.effect)
doCreatureSay(cid, transform.text, transform.textSayType)
end
return true
end
Here's error screen:
I hope you can do something with it ; /