Ir para conteúdo

Featured Replies

  • Respostas 9
  • Visualizações 2.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Ja cheguei a jogar o servidor porém eu nem lembrava mais disso, valeu pelo conteúdo.

  • luanluciano93
    luanluciano93

    @Vinni012  local config = { monsterName = "star", countKillMonster = 3, storageKillMonster = 6665, storagePoints = 7775 } function onDeath(cid, corpse, deathList) local killer = deathList[1

Posted Images

Postado

@Vinni012 

local config = {
	monsterName = "star",
	countKillMonster = 3,
	storageKillMonster = 6665,
	storagePoints = 7775
}

function onDeath(cid, corpse, deathList)

	local killer = deathList[1]
	local pos = getCreaturePosition(killer)
	if not isMonster(cid) or not isPlayer(killer) then
		return true
	end

	if getPlayerStorageValue(killer, config.storageKillMonster) == -1 then
		setPlayerStorageValue(killer, config.storageKillMonster, 0)
	end

	setPlayerStorageValue(killer, config.storageKillMonster, getPlayerStorageValue(killer, config.storageKillMonster) + 1)

	if getPlayerStorageValue(killer, config.storageKillMonster) == config.countKillMonster then
		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)

		if getPlayerStorageValue(killer, config.storagePoints) == -1 then
			setPlayerStorageValue(killer, config.storagePoints, 0)
		end

		setPlayerStorageValue(killer, storagePoints, getPlayerStorageValue(killer, config.storagePoints) + 1)
		setPlayerStorageValue(killer, config.storageKillMonster, 0)
		doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_RED, "You receive 1 vip point by kill ".. config.countKillMonster .."x the monster ".. config.monsterName ..".")
	else
		doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_BLUE, "You killed ".. getPlayerStorageValue(killer, config.storageKillMonster) .." of ".. config.countKillMonster .." ".. config.monsterName ..", There are still ".. config.countKillMonster - (getPlayerStorageValue(killer, config.storageKillMonster)) .." ".. config.monsterName .." left to receive the reward.") 
	end

	return true
end

Mas eu recomendaria fazer por onKill ao invés de onDeath

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

  • 2 years later...

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