LU

Colokar Effect No Personagem

Por Lucaspt, 15 de mar. de 2012 em Scripts

script
21
3.2k
jhon992J
16 de março de 2012 às 17:18

vai em data/creaturescripts/scripts/ duplica um arquivo e nomeia pra "createffect" e nele cola:

function onLogin(cid)
if getPlayerLevel(cid)>= 500 then
   addEvent(creatEffect(cid), 1000, cid)
end
return TRUE
end

function creatEffect(cid)
if (isPlayer) then
local effect = 30 -- efeito
doSendMagicEffect(getPlayerPosition(cid), effect)
addEvent(creatEffect(cid), 1000, cid)
end
end

 

Agora no creaturescripts.xml cola a tag:

<event type="login" name="createffect" event="script" value="createffect.lua"/>

 

Não precisa registrar nada no arquivo login.lua, pq esse script ja é do tipo onLogin.

Obs: Nem testei ele, qualquer erro me fala.

BeekiB
16 de março de 2012 às 20:01

@John

 

seu script é ótimo amigo, o meu eu fiz para por em vocations por que ai poderia diferenciar a aura entre vocações, falow :D

LucasptL
16 de março de 2012 às 23:59

Beeki vou testa o seu ! qual quer coisa coloko aki =x

1 mês depois...
LucasptL
03 de abril de 2012 às 17:55

Beeki

 

deu erro desculpe por demora a responder estava viajando erro \/

 

[03/04/2012 17:54:57] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/lvleffects.lua:21: 'end' expected (to close 'function' at line 4) near '<eof>'

[03/04/2012 17:54:57] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/lvleffects.lua)

[03/04/2012 17:54:57] data/creaturescripts/scripts/lvleffects.lua:21: 'end' expected (to close 'function' at line 4) near '<eof>'

DersinhoD
03 de abril de 2012 às 18:33

bom eu tenhu todas essas aura mais tenhu uma duvida alguem consegue colokar pra quando chega lvl 500 ele começa a usa aura e da 10% protect all alguem sabe?

BeekiB
03 de abril de 2012 às 18:45

Beeki

 

deu erro desculpe por demora a responder estava viajando erro \/

 

[03/04/2012 17:54:57] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/lvleffects.lua:21: 'end' expected (to close 'function' at line 4) near '<eof>'

[03/04/2012 17:54:57] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/lvleffects.lua)

[03/04/2012 17:54:57] data/creaturescripts/scripts/lvleffects.lua:21: 'end' expected (to close 'function' at line 4) near '<eof>'

 

Tenta esse aqui.

 

efeitos = {
[375] = 180,
[8] = 180,
[374] = 7,
[376] = 241,
[377] = 180,
[378] = 241,
[379] = 180,
[380] = 241,
[381] = 180,
[382] = 241,
[383] = 180,
[384] = 241,
[385] = 180,
[254] = 191,
[255] = 34,
}
function doEffect(cid)
local delay = 1
if isCreature(cid) == TRUE then
doSendMagicEffect(getCreaturePosition(cid), efeitos[getPlayerVocation(cid)])
addEvent(doEffect, delay*1000, cid)
end
return TRUE
end
function onLogin(cid)
for voc, efec in pairs(efeitos) do
if voc == getPlayerVocation(cid) then
doEffect(cid)
break
end
end
return TRUE
end