Postado Abril 4, 2018 7 anos Estou criando uma Spell no qual quando o player Casta ele Muda o visual durante o efeito da skill , porém não consigo faze-lo voltar a forma original quando a skill acaba. Como Posso fazer isso ? Codigo da skill : local tempo = 60 local effect = {241} local ml = 55 local outfit = {lookType = 605} function magicEffect118(tempo2,tempo3,cid) if (isCreature(cid)) then if getPlayerStorageValue(cid, 104053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then for i=1, #effect do local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(position, effect[i]) end end end end function onCastSpell(cid, var) if getPlayerStorageValue(cid, 104053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then doCombat(cid, combat, var) tempo2 = 0 tempo3 = 0 while (tempo2 ~= (tempo*1000)) do addEvent(magicEffect118, tempo2, tempo2, tempo*1000, cid) tempo2 = tempo2 + 300 doCreatureChangeOutfit(cid, outfit) tempo3 = tempo3 + 1 end setPlayerStorageValue(cid, 104053,1) else doPlayerSendCancel(cid, "Sorry, you are transformed.") end end
Postado Abril 4, 2018 7 anos local tempo = 60 local effect = {241} local ml = 55 local outfit = {lookType = 605} function magicEffect118(tempo2,tempo3,cid) if (isCreature(cid)) then if getPlayerStorageValue(cid, 104053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then for i=1, #effect do local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(position, effect[i]) end end end end function onCastSpell(cid, var) if getPlayerStorageValue(cid, 104053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then doSetCreatureOutfit(cid, outfit, tempo * 1000) doCombat(cid, combat, var) tempo2 = 0 tempo3 = 0 while (tempo2 ~= (tempo*1000)) do addEvent(magicEffect118, tempo2, tempo2, tempo*1000, cid) tempo2 = tempo2 + 300 tempo3 = tempo3 + 1 end setPlayerStorageValue(cid, 104053,1) else doPlayerSendCancel(cid, "Sorry, you are transformed.") end end Editado Abril 4, 2018 7 anos por Sttorm (veja o histórico de edições)
Postado Abril 4, 2018 7 anos Autor 11 horas atrás, Sttorm disse: local tempo = 60 local effect = {241} local ml = 55 local outfit = {lookType = 605} function magicEffect118(tempo2,tempo3,cid) if (isCreature(cid)) then if getPlayerStorageValue(cid, 104053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then for i=1, #effect do local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(position, effect[i]) end end end end function onCastSpell(cid, var) if getPlayerStorageValue(cid, 104053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then doSetCreatureOutfit(cid, outfit, tempo * 1000) doCombat(cid, combat, var) tempo2 = 0 tempo3 = 0 while (tempo2 ~= (tempo*1000)) do addEvent(magicEffect118, tempo2, tempo2, tempo*1000, cid) tempo2 = tempo2 + 300 tempo3 = tempo3 + 1 end setPlayerStorageValue(cid, 104053,1) else doPlayerSendCancel(cid, "Sorry, you are transformed.") end end Obrigado Editado Abril 4, 2018 7 anos por Arkcanjoo (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.