Bohemia Posted June 11, 2015 Share Posted June 11, 2015 ERROR: [DayZ-MTA]\DayZ\survivorSystem.lua:1462: attempt to perform arithmetic on a boolean value To Com esse erro acima /\, quando tento equipa uma skin de personagem !! Codigo: Função que chama: Inventory.lua elseif itemInfo == "Change you clother" then triggerServerEvent("onPlayerChangeSkin",getLocalPlayer(),itemName) -- Arquivo onde esta dando erro: Linha do Erro: setElementData(source,name,getElementData(source,name)+1) Completo: function addPlayerSkin (skin) local current = getElementData(source,"skin") local name = getSkinNameFromID(current) setElementData(source,name,getElementData(source,name)+1) setElementData(source,skin,getElementData(source,skin)-1) local id = getSkinIDFromName(skin) setElementData(source,"skin",id) setElementModel(source,id) triggerClientEvent(source,"refreshInventoryManual",source) end addEvent("onPlayerChangeSkin",true) addEventHandler("onPlayerChangeSkin",getRootElement(),addPlayerSkin) ---- Obrigado pela ajuda de todos voces !! Link to comment
Banex Posted June 18, 2015 Share Posted June 18, 2015 tente isso: function addPlayerSkin (skin) local current = getElementData(source,"skin") local name = getSkinNameFromID(current) setElementData(source,name,(getElementData(source,name) or 0)+1) setElementData(source,skin,(getElementData(source,skin) or 0)-1) local id = getSkinIDFromName(skin) setElementData(source,"skin",id) setElementModel(source,id) triggerClientEvent(source,"refreshInventoryManual",source) end addEvent("onPlayerChangeSkin",true) addEventHandler("onPlayerChangeSkin",getRootElement(),addPlayerSkin) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now