MA
dúvida

Exp vem proporcional à variável

Por Martelix, 08 de nov. de 2013 em Scripts

[lua]
resolvido
script
3
557
MartelixM
08 de novembro de 2013 às 19:04

Gente estou tentando fazer um script que caso o player seja maior que tal level ele ganhará exp proporcional à uma variável randomica, segue:

 

function onKill(cid, target, lastHit)    local monstreco = getCreatureName(target)    local monstrecoexp = getMonsterInfo(monstreco).experience    if isPlayer(cid) and isMonster(target) and lastHit then        if getPlayerLevel(cid) > 70 then            local t = math.random(1,10)            doPlayerAddExp(cid, -monstrecoexp)            doPlayerAddExp(cid, monstrecoexp*(t/10))        end    endreturn trueend

 

 

Eu tentei assim mas não funcionou ;/

Alguém ajuda!

KilluaK
08 de novembro de 2013 às 23:17

Nao da erro nehum ne?

 

Eu sempre tenho problemas com esse tipo de creaturescripts, mas tenho umas sugestoes: muda essa linha if isPlayer(cid) and isMonster(target) and lastHit then pra if isPlayer(lastHitKiller) and isMonster(target) then

e se nao funcionar, tenta fazer por onDeath

 

Abracos

2 meses depois...
zipter98Z
15 de janeiro de 2014 às 21:44

Tópico movido para a seção de dúvidas e pedidos resolvidos.