Ir para conteúdo
  • Cadastre-se

(Resolvido)Colocar contagem de mob nesse script


Ir para solução Resolvido por Vodkart,

Posts Recomendados

Olá a todos, Gostaria de colocar uma contagem nessa parte do script ou seja, aparecer no default em laranja a cada mob que for morto.

 

Script: (Creaturescript)

	if(isMonster(target) == TRUE) then
		if getCreatureName(target) == "Renegade" then
			if(getPlayerStorageValue(cid,19100) <= 0) then
			setPlayerStorageValue(cid, 19100, 1)
			else
			setPlayerStorageValue(cid, 19100, getPlayerStorageValue(cid,19100)+1)
			end
		end

Essa parte fica no final do script:

if(getPlayerStorageValue(cid,19100) >= 75) then
			setPlayerStorageValue(cid, 9100, 1)

 

Essa aqui e onde fica no npc:

		elseif (isFocused(cid) and msg == "c rank") and getPlayerStorageValue(cid,9001) == 2 then
                selfSay("Mission {C-2}: Kill 75 Renegades then back and say {mission}.", cid)
		
		elseif (isFocused(cid) and msg == "mission") and getPlayerStorageValue(cid,9001) == 2 and getPlayerStorageValue(cid,9100) == 1 then
		doPlayerAddExp(cid,75000)
                doPlayerAddItem(cid,2160,3)
		setPlayerStorageValue(cid,9001,3)
		selfSay("Well, ".. getCreatureName(cid) ..". mission C-2 Success!", cid)

 

Link para o post
Compartilhar em outros sites
Em 20/06/2020 em 13:53, leozincorsair disse:

Script: (Creaturescript)

	if(isMonster(target) == true) then
		if getCreatureName(target) == "Renegade" then
			if(getPlayerStorageValue(cid,19100) <= 0) then
			setPlayerStorageValue(cid, 19100, 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "1/75 Renegades mortos.")
			else
			setPlayerStorageValue(cid, 19100, getPlayerStorageValue(cid,19100) + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerStorageValue(cid,19100) .. "/75 monstros Renegades mortos.")
			end
		end

 

Editado por luanluciano93 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
5 horas atrás, luanluciano93 disse:

	if(isMonster(target) == true) then
		if getCreatureName(target) == "Renegade" then
			if(getPlayerStorageValue(cid,19100) <= 0) then
			setPlayerStorageValue(cid, 19100, 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "1/75 Renegades mortos.")
			else
			setPlayerStorageValue(cid, 19100, getPlayerStorageValue(cid,19100) + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerStorageValue(cid,19100) .. "/75 monstros Renegades mortos.")
			end
		end

 

Obrigado , me ajudou mttt <3

5 horas atrás, luanluciano93 disse:

	if(isMonster(target) == true) then
		if getCreatureName(target) == "Renegade" then
			if(getPlayerStorageValue(cid,19100) <= 0) then
			setPlayerStorageValue(cid, 19100, 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "1/75 Renegades mortos.")
			else
			setPlayerStorageValue(cid, 19100, getPlayerStorageValue(cid,19100) + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerStorageValue(cid,19100) .. "/75 monstros Renegades mortos.")
			end
		end

 

Só tem um probleminha, quando termina de matar os 75 a contagem continua mesmo eu entregando a missão pro npc.

 

Screenshot_54.png

Link para o post
Compartilhar em outros sites

@leozincorsair 

 

	if isMonster(target) == true and getCreatureName(target) == "Renegade" then
		local amount = getPlayerStorageValue(cid,19100) <= 0 and 0 or getPlayerStorageValue(cid, 19100)
			if amount < 75 then
				setPlayerStorageValue(cid, 19100, amount+1)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19100).."/75 Renegades.")
			end
		end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
2 horas atrás, Vodkart disse:

@leozincorsair 

 


	if isMonster(target) == true and getCreatureName(target) == "Renegade" then
		local amount = getPlayerStorageValue(cid,19100) <= 0 and 0 or getPlayerStorageValue(cid, 19100)
			if amount < 75 then
				setPlayerStorageValue(cid, 19100, amount+1)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19100).."/75 Renegades.")
			end
		end

deu esse error

 

Screenshot_55.png

Link para o post
Compartilhar em outros sites
	if isMonster(target) == true and getCreatureName(target) == "Renegade" then
		local amount = getPlayerStorageValue(cid,19100) <= 0 and 0 or getPlayerStorageValue(cid, 19100)
		if amount < 75 then
			setPlayerStorageValue(cid, 19100, amount+1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19100).."/75 Renegades.")
		end
Link para o post
Compartilhar em outros sites
1 hora atrás, luanluciano93 disse:

	if isMonster(target) == true and getCreatureName(target) == "Renegade" then
		local amount = getPlayerStorageValue(cid,19100) <= 0 and 0 or getPlayerStorageValue(cid, 19100)
		if amount < 75 then
			setPlayerStorageValue(cid, 19100, amount+1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19100).."/75 Renegades.")
		end

obrigado, funcionou !

2 horas atrás, luanluciano93 disse:

	if isMonster(target) == true and getCreatureName(target) == "Renegade" then
		local amount = getPlayerStorageValue(cid,19100) <= 0 and 0 or getPlayerStorageValue(cid, 19100)
		if amount < 75 then
			setPlayerStorageValue(cid, 19100, amount+1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19100).."/75 Renegades.")
		end

 

function onKill(cid, target)


	if(isPlayer(target) == TRUE and getPlayerStorageValue(cid,9103) ~= 1) then	
		setPlayerStorageValue(cid, 9103, 1)
	end

       if isMonster(target) == true and getCreatureName(target) == "Renegade" then
		local amount = getPlayerStorageValue(cid,19100) <= 0 and 0 or getPlayerStorageValue(cid, 19100)
		if amount < 75 then
		setPlayerStorageValue(cid, 19100, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19100).."/75 Renegades.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Nukenin" then
		local amount = getPlayerStorageValue(cid,19101) <= 0 and 0 or getPlayerStorageValue(cid, 19101)
		if amount < 100 then
		setPlayerStorageValue(cid, 19101, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19101).."/100 Nukenins.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Anbu" then
		local amount = getPlayerStorageValue(cid,19102) <= 0 and 0 or getPlayerStorageValue(cid, 19102)
		if amount < 100 then
		setPlayerStorageValue(cid, 19102, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19102).."/100 Anbus.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Konan" then
		local amount = getPlayerStorageValue(cid,19104) <= 0 and 0 or getPlayerStorageValue(cid, 19104)
		if amount < 100 then
		setPlayerStorageValue(cid, 19104, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19104).."/100 Konans.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Larva" then
		local amount = getPlayerStorageValue(cid,19105) <= 0 and 0 or getPlayerStorageValue(cid, 19105)
		if amount < 200 then
		setPlayerStorageValue(cid, 19105, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19105).."/200 Larvas.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Aranha" then
		local amount = getPlayerStorageValue(cid,19106) <= 0 and 0 or getPlayerStorageValue(cid, 19106)
		if amount < 100 then
		setPlayerStorageValue(cid, 19106, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19106).."/100 Aranhas.")
		end
		
       if isMonster(target) == true and getCreatureName(target) == "Black Dragon" then
		local amount = getPlayerStorageValue(cid,19107) <= 0 and 0 or getPlayerStorageValue(cid, 19107)
		if amount < 10 then
		setPlayerStorageValue(cid, 19107, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19107).."/10 Black Dragons.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Black Machine" then
		local amount = getPlayerStorageValue(cid,19108) <= 0 and 0 or getPlayerStorageValue(cid, 19108)
		if amount < 10 then
		setPlayerStorageValue(cid, 19108, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19108).."/10 Black Machines.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Evill Ghost" then
		local amount = getPlayerStorageValue(cid,19109) <= 0 and 0 or getPlayerStorageValue(cid, 19109)
		if amount < 10 then
		setPlayerStorageValue(cid, 19109, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19109).."/10 Evill Ghosts.")
		end

       if isMonster(target) == true and getCreatureName(target) == "Evill Snake" then
		local amount = getPlayerStorageValue(cid,19110) <= 0 and 0 or getPlayerStorageValue(cid, 19110)
		if amount < 300 then
		setPlayerStorageValue(cid, 19110, amount+1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, 19110).."/300 Evill Snakes.")
		end		
if(getPlayerStorageValue(cid,19100) >= 75) then
			setPlayerStorageValue(cid, 9100, 1)
end
if(getPlayerStorageValue(cid,19101) >= 100) then
			setPlayerStorageValue(cid, 9101, 1)
end
if(getPlayerStorageValue(cid,19102) >= 100) then
			setPlayerStorageValue(cid, 9102, 1)
end
if(getPlayerStorageValue(cid,19104) >= 100) then
			setPlayerStorageValue(cid, 9104, 1)
end
if(getPlayerStorageValue(cid,19105) >= 200) then
			setPlayerStorageValue(cid, 9105, 1)
end
if(getPlayerStorageValue(cid,19106) >= 100) then
			setPlayerStorageValue(cid, 9106, 1)
end
if(getPlayerStorageValue(cid,19107) >= 10) then
			setPlayerStorageValue(cid, 9107, 1)
end
if(getPlayerStorageValue(cid,19108) >= 10) then
			setPlayerStorageValue(cid, 9108, 1)
end
if(getPlayerStorageValue(cid,19109) >= 10) then
			setPlayerStorageValue(cid, 9109, 1)
end
if(getPlayerStorageValue(cid,19110) >= 300) then
			setPlayerStorageValue(cid, 9110, 1)
end
	end
	return TRUE
end

deu esse erro ao fazer em todas

Screenshot_56.png

Link para o post
Compartilhar em outros sites
  • Solução

@leozincorsair 

 

local tab = {
  ["Renegade"] = {storage = 19100, amount = 75, storage_reward = 9100},
  ["Nukenin"] = {storage = 19101, amount = 100, storage_reward = 9101},
  ["Anbu"] = {storage = 19102, amount = 100, storage_reward = 9102},
  ["Konan"] = {storage = 19104, amount = 100, storage_reward = 9104},
  ["Larva"] = {storage = 19105, amount = 200, storage_reward = 9105},
  ["Aranha"] = {storage = 19106, amount = 100, storage_reward = 9106},
  ["Black Dragon"] = {storage = 19107, amount = 10, storage_reward = 9107},
  ["Black Machine"] = {storage = 19108, amount = 10, storage_reward = 9108},
  ["Evill Ghost"] = {storage = 19109, amount = 10, storage_reward = 9109},
  ["Evill Snake"] = {storage = 191010, amount = 300, storage_reward = 9110}
}
function onKill(cid, target)
  if(isPlayer(target) == TRUE and getPlayerStorageValue(cid,9103) ~= 1) then
    setPlayerStorageValue(cid, 9103, 1)
  end
  local ret = tab[getCreatureName(target)]
  if isMonster(target) == true and ret then
    local amount = getPlayerStorageValue(cid, ret.storage) <= 0 and 0 or getPlayerStorageValue(cid, ret.storage)
    if amount < ret.amount then
      setPlayerStorageValue(cid, ret.storage, amount+1)
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, ret.storage).."/"..ret.amount.." "..getCreatureName(target)..".")
    end
    if getPlayerStorageValue(cid, ret.storage) >= ret.amount then
      setPlayerStorageValue(cid, ret.storage_reward, 1)
    end
  end
  return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
1 hora atrás, Vodkart disse:

@leozincorsair 

 


local tab = {
  ["Renegade"] = {storage = 19100, amount = 75, storage_reward = 9100},
  ["Nukenin"] = {storage = 19101, amount = 100, storage_reward = 9101},
  ["Anbu"] = {storage = 19102, amount = 100, storage_reward = 9102},
  ["Konan"] = {storage = 19104, amount = 100, storage_reward = 9104},
  ["Larva"] = {storage = 19105, amount = 200, storage_reward = 9105},
  ["Aranha"] = {storage = 19106, amount = 100, storage_reward = 9106},
  ["Black Dragon"] = {storage = 19107, amount = 10, storage_reward = 9107},
  ["Black Machine"] = {storage = 19108, amount = 10, storage_reward = 9108},
  ["Evill Ghost"] = {storage = 19109, amount = 10, storage_reward = 9109},
  ["Evill Snake"] = {storage = 191010, amount = 300, storage_reward = 9110}
}
function onKill(cid, target)
  if(isPlayer(target) == TRUE and getPlayerStorageValue(cid,9103) ~= 1) then
    setPlayerStorageValue(cid, 9103, 1)
  end
  local ret = tab[getCreatureName(target)]
  if isMonster(target) == true and ret then
    local amount = getPlayerStorageValue(cid, ret.storage) <= 0 and 0 or getPlayerStorageValue(cid, ret.storage)
    if amount < ret.amount then
      setPlayerStorageValue(cid, ret.storage, amount+1)
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou "..getPlayerStorageValue(cid, ret.storage).."/"..ret.amount.." "..getCreatureName(target)..".")
    end
    if getPlayerStorageValue(cid, ret.storage) >= ret.amount then
      setPlayerStorageValue(cid, ret.storage_reward, 1)
    end
  end
  return true
end

 

The best <3

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo