Jump to content

Ajuda em Erro, porfavor !


Recommended Posts

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) 
  

h678ylq.png

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...