Postado Março 2, 2020 5 anos .Qual servidor ou website você utiliza como base? TFS 1.2 Está surgindo algum erro? Se sim coloque-o aqui. Quote Lua Script Error: [Weapon Interface] data/weapons/scripts/bleeding_effect.lua:onUseWeapon data/weapons/scripts/bleeding_effect.lua:24: attempt to index global 'player' (a nil value) stack traceback: [C]: in function '__index' data/weapons/scripts/bleeding_effect.lua:24: in function <data/weapons/scripts/bleeding_effect.lua:7> Você tem o código disponível? Se tiver publique-o aqui: local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true) combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true) combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0) function onUseWeapon(player, variant) local target = Creature(variant:getNumber()) if not combat:execute(player, variant) then return false end if math.random(1, 100) > 75 then return false end if target:isPlayer() then local damage = math.floor((player:getEffectiveSkillLevel(SKILL_AXE) * 0.01) + 1) player:addDamageCondition(target, CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 1, 4) else local damage = math.floor((player:getEffectiveSkillLevel(SKILL_AXE) * 0.02) + 1) player:addDamageCondition(target, CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 2, 4) end return true end
Postado Março 4, 2020 5 anos Em 02/03/2020 em 22:52, Wizav w0w disse: .Qual servidor ou website você utiliza como base? TFS 1.2 Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true) combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true) combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0) function onUseWeapon(player, variant) local target = Creature(variant:getNumber()) if not combat:execute(player, variant) then return false end if math.random(1, 100) > 75 then return false end if target:isPlayer() then local damage = math.floor((player:getEffectiveSkillLevel(SKILL_AXE) * 0.01) + 1) player:addDamageCondition(target, CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 1, 4) else local damage = math.floor((player:getEffectiveSkillLevel(SKILL_AXE) * 0.02) + 1) player:addDamageCondition(target, CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 2, 4) end return true end Talvez seja o math.floor, tente colocar player:getEffectiveSkillLevel(SKILL_AXE) em uma variável, ou utilize math.ceil(), ou apenas deixe a função.
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.