Hello im Newbie on script lua but i try to translate my scripts on tfs 0.3.6pl to tfs 1.2 and i have problem
this is my scripts on tfs 0.3.6pl
and this is my attempt to translate please dont laugh im newbie
Could someone explain to me straight? :/
this is my scripts on tfs 0.3.6pl
Lua:
local config =
{
[1] = {efe= 12,hp= 0.02,mn= 0.01, time= 2,efesum= 12}
}
function onThink(cid, interval)
if(isCreature(cid)) and (not exhaustion.get (cid,21410)) then
doSendMagicEffect(cid,config[1].efe)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), config[1].efesum)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) *config[1].hp)
doCreatureAddMana(cid, getCreatureMaxMana(cid) *config[1].mn)
exhaustion.set(cid, 21410, config[1].time)
end
end
and this is my attempt to translate please dont laugh im newbie
Lua:
local config =
{
[1] = {efe= 12,hp= 300,mn= 200, time= 2,efesum= 12}
}
}
function onThink(cid, interval)
if(exhaust(cid, 21410, config[1].time) == 0) and Player:getStorageValue(config[1][1]) == 2 then
player:getPosition():sendMagicEffect(config[1].efe)
player:getThingPos(getCreatureSummons(cid)[1]:sendMagicEffect(config[1].efe)
creature:addHealth(config[1].hp)
creature:addMana(config[1].mn)
exhaust(cid, 21410, config[1].time)
end
end
Could someone explain to me straight? :/