Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

Tfs 1.3

 

Qual o motivo deste tópico? 

 

Tenho um script que quando player x, mata player y. Ganha x quantidade de exp e platinum coins, queria passar o mesmo para Revscriptsys

 

Você tem o código disponível? Se tiver publique-o aqui: 

local config = {
--{exp, item, quantidade}
	{40000, 2152, 5}, -- menor
	{90000, 2152, 6}, -- mesmo
	{110000, 2152, 7}, -- maior
}

function onKill(cid, target)
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerLevel(target) < getPlayerLevel(cid) then
			doPlayerAddItem(cid, config[1][2], config[1][3])
			doPlayerAddExp(cid, config[1][1])
			
		elseif getPlayerLevel(target) == getPlayerLevel(cid) then
			doPlayerAddItem(cid, config[2][2], config[2][3])
			doPlayerAddExp(cid, config[2][1])
			
		elseif getPlayerLevel(target) > getPlayerLevel(cid) then
			doPlayerAddItem(cid, config[3][2], config[3][3])
			doPlayerAddExp(cid, config[3][1])
		end
	end
	return true
end

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Postado

@Freitas Epilef Boa noite, vê se é isso que você quer

 

local config = {
  --{exp, item, quantidade}
  {40000, 2152, 5}, -- menor
  {90000, 2152, 6}, -- mesmo
  {110000, 2152, 7}, -- maior
}

local event = CreatureEvent("PlayerReward")

function event.onKill(creature, target)

  local player = Player(creature)

  if (player:isPlayer() and target:isPlayer()) then

    if (target:getLevel() < player:getLevel()) then
      player:addItem(config[1][2], config[1][3])
      player:addExperience(config[1][1])
    end

    elseif (target:getLevel() == player:getLevel()) then
      player:addItem(config[2][2], config[2][3])
      player:addExperience(config[2][1])
    end

      player:addItem(config[3][2], config[3][3])
      player:addExperience(config[3][1])
    end
    
end

event:register()

local login = CreatureEvent("RegisterPlayerReward")

function login.onLogin(player)
    player:registerEvent("PlayerReward")
    return true
end

login:register()

 

Postado
6 minutos atrás, MatteusDeli disse:

@Freitas Epilef Boa noite, vê se é isso que você quer

 


local config = {
  --{exp, item, quantidade}
  {40000, 2152, 5}, -- menor
  {90000, 2152, 6}, -- mesmo
  {110000, 2152, 7}, -- maior
}

local event = CreatureEvent("PlayerReward")

function event.onKill(creature, target)

  local player = Player(creature)

  if (player:isPlayer() and target:isPlayer()) then

    if (target:getLevel() < player:getLevel()) then
      player:addItem(config[1][2], config[1][3])
      player:addExperience(config[1][1])
    end

    elseif (target:getLevel() == player:getLevel()) then
      player:addItem(config[2][2], config[2][3])
      player:addExperience(config[2][1])
    end

      player:addItem(config[3][2], config[3][3])
      player:addExperience(config[3][1])
    end
    
end

event:register()

local login = CreatureEvent("RegisterPlayerReward")

function login.onLogin(player)
    player:registerEvent("PlayerReward")
    return true
end

login:register()

 

isso mesmo, muito obrigado: D, só remover 1 end acima de event:register()

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