Postado Novembro 2, 2015 9 anos Boa Noite, Alguém sabe me dizer que erro seria esse? Lua Script Error: [Event Interface] data/events/scripts/party.lua:Party@onShareExperience data/events/scripts/party.lua:35: attempt to perform arithmetic on a table value stack traceback: [C]: in function '__add' data/events/scripts/party.lua:35: in function abs
Postado Novembro 2, 2015 9 anos Autor Minha script é a seguinte function Party:onJoin(player) return true end function Party:onLeave(player) return true end function Party:onDisband() return true end function Party:onShareExperience(exp) local sharedExperienceMultiplier = 1.20 --20% local vocationsIds = {} local vocationId = self:getLeader():getVocation():getId() if vocationId ~= VOCATION_NONE then table.insert(vocationsIds, self:getLeader():getVocation():getId()) end for _, member in ipairs(self:getMembers()) do vocationId = member:getVocation():getId() if not isInArray(vocationsIds, vocationId) and vocationId ~= VOCATION_NONE then table.insert(vocationsIds, vocationId) end end local size = #vocationsIds if size > 1 then sharedExperienceMultiplier = 1.0 + ((size * (10 + (size - 1) * 5)) / 100) end exp = (exp * sharedExperienceMultiplier) / (self:getMembers() + 1) return exp end
Postado Novembro 3, 2015 9 anos function Party:onJoin(player) return true end function Party:onLeave(player) return true end function Party:onDisband() return true end function Party:onShareExperience(exp) local sharedExperienceMultiplier = 1.20 --20% local vocationsIds = {} local vocationId = self:getLeader():getVocation():getId() if vocationId ~= VOCATION_NONE then vocationsIds[#vocationsIds + 1] = self:getLeader():getVocation():getId() end for _, member in ipairs(self:getMembers()) do vocationId = member:getVocation():getId() if not isInArray(vocationsIds, vocationId) and vocationId ~= VOCATION_NONE then vocationsIds[#vocationsIds + 1] = vocationId end end local size = #vocationsIds if size > 1 then sharedExperienceMultiplier = 1.0 + ((size * (10 + (size - 1) * 5)) / 100) end exp = (exp * sharedExperienceMultiplier) / (self:getMembers() + 1) return exp end Discord: vankk #7765 Precisando de ajuda? Entre em contato comigo via Discord. Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.
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.