Ir para conteúdo

Featured Replies

  • Respostas 29
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • function onKill(cid, target) if isPlayer(cid) and isPlayer(target) then doSetItemSpecialDescription(doPlayerAddItem(cid, 5943, 1), "name", "" ..getPlayerName(target).. " Heart's")

  • doSetItemSpecialDescription só tem 2 parâmetros: uid e description E desse jeito adicionaria 2 items ao jogador. O correto seria criar uma variável com valor de doPlayerAddItem(cid, 5943, 1). Depois

  • @ADM Lucas OTBR Pronto agr vai funcionar testei aqui. function onKill(cid, target) if isPlayer(cid) and isPlayer(target) == true then local heart = doPlayerAddItem(cid, 5943, 1) doItemSetAtt

Postado

Olá amigo, conheço um Sistema que está postado aqui no fórum, não sei se te interessa, porque ele te da o coração automaticamente. 

Pode verificar, e espero que goste!

 

Data>CreatureScripts>scripts crie um arquivo .lua chamado hearts.lua e poe dentro:

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    local cidpos = getPlayerPosition(lastHitKiller)
    loot = 5943
    item = doPlayerAddItem(lastHitKiller,loot,1)
    if(isPlayer(lastHitKiller) == TRUE) then
	    hitKillerName = getPlayerName(lastHitKiller)
	    doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..hitKillerName..".")
	    doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
	    doSendMagicEffect(cidpos,12)
    else
	    hitKillerName = getCreatureName(lastHitKiller)
	    doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by a "..hitKillerName..".")
    end
    setItemName(item, ""..getPlayerName(cid).."\'s Heart")
    return TRUE
end

Depois volta para creaturescripts.xml e adiciona a tag:

<event type="death" name="Reward" event="script" value="hearts.lua"/>

Crédito do script: TonyHalk

xBlackWolf

THX @Storm Night

Best Avatar Ever

 

9p0FoTd.png

Postado

 

Olá amigo, conheço um Sistema que está postado aqui no fórum, não sei se te interessa, porque ele te da o coração automaticamente. 

Pode verificar, e espero que goste!

 

Data>CreatureScripts>scripts crie um arquivo .lua chamado hearts.lua e poe dentro:

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    local cidpos = getPlayerPosition(lastHitKiller)
    loot = 5943
    item = doPlayerAddItem(lastHitKiller,loot,1)
    if(isPlayer(lastHitKiller) == TRUE) then
	    hitKillerName = getPlayerName(lastHitKiller)
	    doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..hitKillerName..".")
	    doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
	    doSendMagicEffect(cidpos,12)
    else
	    hitKillerName = getCreatureName(lastHitKiller)
	    doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by a "..hitKillerName..".")
    end
    setItemName(item, ""..getPlayerName(cid).."\'s Heart")
    return TRUE
end

Depois volta para creaturescripts.xml e adiciona a tag:

<event type="death" name="Reward" event="script" value="hearts.lua"/>

Crédito do script: TonyHalk

 

Tem que ve o id do item pra ve se não tem nenhuma função no ot dele 

quando postar tutorias assim defina algumas coisas com 1 outra cor e explique como ele editar para ajudar ele e ganhar seu rep com mais facilidade

Meus Trabalhos
 
Tudo em Desenvolvimento mais att em breve
Estou parado
 
Tudo Removido
Postado

^^

function onKill(cid, target) 

local config = 
{	Kname = getPlayerName(cid),
	Tname = getPlayerName(target),
	Tlevel = getPlayerLevel(target),
	heart = doPlayerAddItem(cid, 5943, 1)
}
 
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
			doSetItemSpecialDescription(config.heart, "name", "" ..config.Tname.. " Heart's")
			doSetItemSpecialDescription(config.heart, "description", "Killed at Level "..config.Tlevel.." by "..config.Kname..". " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "(Unjustified)" or "(Justified)"))
 
		elseif getPlayerIp(cid) == getPlayerIp(target) then
			doPlayerAddExp(cid, -10000)
		end
	end
return true
end
<event type="kill" name="hearts" event="script" value="nomedoarquivo.lua"/>

Não se esqueça de alterar o value"nomedoarquivo.lua" com o que você colocar.

 

 

em data/creaturescripts/login.lua antes do ultimo "return true" adicione :

registerCreatureEvent(cid, "hearts") 

EQD4Qy4.gif

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.6k

Informação Importante

Confirmação de Termo