Ir para conteúdo

Featured Replies

Postado
  • Autor
27 minutos atrás, Xagah disse:

Tenta assim:


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)

function onGetFormulaValues(cid, level, item)
local arma= getPlayerWeapon(cid).uid
darma= getItemAttribute(arma.uid, 'attack')
skillsword= getPlayerSkill(cid, 2)
local forca= getPlayerStorageValue(cid, 70001)
local agilidade= getPlayerStorageValue(cid, 70003)
min = -(level*0.25) + -(forca*0.5) + -(agilidade*0.2) + -(skillsword*0.4) + -darma
max = -(level*0.35) + -(forca*0.6) + -(agilidade*0.3) + -(skillsword*0.8) + -darma
return min, max
end


setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

 

Ainda continua dando o msm erro eu nao csg revoler:

[14/01/2016 20:31:53] [Error - Weapon Interface] 
[14/01/2016 20:31:53] In a callback: data/weapons/scripts/sword.lua:onGetFormulaValues
[14/01/2016 20:31:53] (Unknown script file)
[14/01/2016 20:31:53] Description: 
[14/01/2016 20:31:53] data/weapons/scripts/sword.lua:10: attempt to index local 'arma' (a number value)

 

  • Respostas 22
  • Visualizações 1.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Tenta assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, CO

  • Tenta assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, CO

  • Vamo lá, tenta isto: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1) setCombatParam(combat, COMBAT_PARAM_

Postado

Vamo lá, tenta isto:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)

function onGetFormulaValues(cid, level, item)
local arma= getPlayerWeapon(cid)
local darma= getItemAttack(arma)
local skillsword= getPlayerSkill(cid, 2)
local forca= getPlayerStorageValue(cid, 70001)
local agilidade= getPlayerStorageValue(cid, 70003)
min = -(level*0.25) + -(forca*0.5) + -(agilidade*0.2) + -(skillsword*0.4) + -darma
max = -(level*0.35) + -(forca*0.6) + -(agilidade*0.3) + -(skillsword*0.8) + -darma
return min, max
end


setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

 

Postado
  • Autor
44 minutos atrás, Xagah disse:

Vamo lá, tenta isto:


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)

function onGetFormulaValues(cid, level, item)
local arma= getPlayerWeapon(cid)
local darma= getItemAttack(arma)
local skillsword= getPlayerSkill(cid, 2)
local forca= getPlayerStorageValue(cid, 70001)
local agilidade= getPlayerStorageValue(cid, 70003)
min = -(level*0.25) + -(forca*0.5) + -(agilidade*0.2) + -(skillsword*0.4) + -darma
max = -(level*0.35) + -(forca*0.6) + -(agilidade*0.3) + -(skillsword*0.8) + -darma
return min, max
end


setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

 

Cara eu nao entendo de todo jeito ou retorna nill ou fala q nao e um numero como aconteceu antes, erro do lua:

[14/01/2016 21:28:18] [Error - Weapon Interface] 
[14/01/2016 21:28:18] In a callback: data/weapons/scripts/sword.lua:onGetFormulaValues
[14/01/2016 21:28:18] (Unknown script file)
[14/01/2016 21:28:18] Description: 
[14/01/2016 21:28:18] data/weapons/scripts/sword.lua:10: attempt to call global 'getItemAttack' (a nil value)

 

Postado

Mais um teste:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)

function onGetFormulaValues(cid, level, item)
	-- local arma= getPlayerWeapon(cid)
	-- local darma= getItemAttack(arma)
	local skillsword= getPlayerSkill(cid, 2)
	local forca= getPlayerStorageValue(cid, 70001)
	local agilidade= getPlayerStorageValue(cid, 70003)
	local item1 = getPlayerSlotItem(cid, CONST_SLOT_LEFT)
	local item2 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
	local atk, atk1, atk2 = 0, 0, 0

	if item1.uid ~= 0 then
		atk1 = getItemAttack(item1.uid)
	end
	
	if item2.uid ~= 0 then
		atk2 = getItemAttack(item2.uid)
	end
	
	if atk1 > atk2 then
		atk = atk1
	else
		atk = atk2
end

	min = -(level*0.25) + -(forca*0.5) + -(agilidade*0.2) + -(skillsword*0.4) + -atk
	max = -(level*0.35) + -(forca*0.6) + -(agilidade*0.3) + -(skillsword*0.8) + -atk
	return min, max
	
end


setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

Edited:

 

Tinha um trecho diferente. Copia agora.

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

Postado
  • Autor
11 minutos atrás, Xagah disse:

Mais um teste:


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)

function onGetFormulaValues(cid, level, item)
	-- local arma= getPlayerWeapon(cid)
	-- local darma= getItemAttack(arma)
	local skillsword= getPlayerSkill(cid, 2)
	local forca= getPlayerStorageValue(cid, 70001)
	local agilidade= getPlayerStorageValue(cid, 70003)
	local item1 = getPlayerSlotItem(cid, CONST_SLOT_LEFT)
	local item2 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
	local atk, atk1, atk2 = 0, 0, 0

	if item1.uid ~= 0 then
		atk1 = getItemAttack(item1.uid)
	end
	
	if item2.uid ~= 0 then
		atk2 = getItemAttack(item2.uid)
	end
	
	if atk1 > atk2 then
		atk = atk1
	else
		atk = atk2
end

	min = -(level*0.25) + -(forca*0.5) + -(agilidade*0.2) + -(skillsword*0.4) + -atk
	max = -(level*0.35) + -(forca*0.6) + -(agilidade*0.3) + -(skillsword*0.8) + -atk
	return min, max
	
end


setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

Edited:

 

Tinha um trecho diferente. Copia agora.

 

 

Cara o erro continua o mesmo eu ainda tentei trocar o 0 por nil pra ve se ia mas nem assim

erro do lua:

[14/01/2016 21:50:43] [Error - Weapon Interface] 
[14/01/2016 21:50:43] In a callback: data/weapons/scripts/sword.lua:onGetFormulaValues
[14/01/2016 21:50:43] (Unknown script file)
[14/01/2016 21:50:43] Description: 
[14/01/2016 21:50:43] data/weapons/scripts/sword.lua:10: attempt to call global 'getItemAttack' (a nil value)

 

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