Ir para conteúdo

Featured Replies

Postado

Olá amigos estou tentando adicionar o Scripts para deixa mana ful e hp ful quando char upa.

 

 

-- by Shoeei for OTServ Brásil Fórums --
function onAdvance(cid, skill, oldlevel, newlevel)
if skill == SKILL__LEVEL then
local maxh = getCreatureMaxHealth(cid)
local maxm = getCreatureMaxMana(cid)
doCreatureAddHealth(cid, maxh)
doCreatureAddMana(cid, maxm)
end
return true
end

 

 

Estou testando aqui e não esta deixando a mana ful e nem o hp. e nao da neum erro no Distro nem nada.

Alguém ?

 

Postado

Não funcionou este ?

92396059.png

                                                                                                                                                                                  

Postado

Em meu servidor de testes esse funciona perfeitamente.

local config = {
          savePlayer = true,
          healPlayerOnLevel = true
}
 
function onAdvance(cid, skill, oldLevel, newLevel)
          if(skill == SKILL__EXPERIENCE) then
                     return true
          end
          if(skill == SKILL__LEVEL and config.healPlayerOnLevel) then
                    doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
                    doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
          end
          if(config.savePlayer) then
                    doPlayerSave(cid, true)
          end
          return true
end

 

Att.

Giovani Rodrigo

Editado por GiovaniRodrigo (veja o histórico de edições)

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

Postado

esse ai é creaturescripts ?

 

Sim, é creaturescripts.

 

Ai esta a tag dele, caso precisar

 

<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

 

Att.

Giovani Rodrigo

Editado por GiovaniRodrigo (veja o histórico de edições)

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo