Jump to content

How to fix


Recommended Posts

Help plz

survivorSystem.Lua:831: Bas argument @ 'destroyElement' [Expected element at argument 1]

 

function removeAttachedOnDeath ()
        if elementWeaponbBack[source] then
            detachElementFromBone(elementWeaponbBack[source])
            destroyElement(elementWeaponbBack[source])    
            elementWeaponbBack[source] = false
        end  
        if elementWeaponRaplace[source] then
            detachElementFromBone(elementWeaponRaplace[source])
            destroyElement(elementWeaponRaplace[source])         
            elementWeaponRaplace[source] = false
        end
  -- Erro abaixo
        if elementBackpack[source] then
            detachElementFromBone(elementBackpack[source])
            destroyElement(elementBackpack[source])
        end
  --
        if elementWeaponBack[source] then
            detachElementFromBone(elementWeaponBack[source])
            destroyElement(elementWeaponBack[source])   
            elementWeaponBack[source] = false
        end 
end
addEvent("kilLDayZPlayer",true)
addEventHandler("kilLDayZPlayer",getRootElement(),removeAttachedOnDeath)

 

Link to post
2 hours ago, ViniciusMc478 said:

Help plz

survivorSystem.Lua:831: Bas argument @ 'destroyElement' [Expected element at argument 1]

 


function removeAttachedOnDeath ()
        if elementWeaponbBack[source] then
            detachElementFromBone(elementWeaponbBack[source])
            destroyElement(elementWeaponbBack[source])    
            elementWeaponbBack[source] = false
        end  
        if elementWeaponRaplace[source] then
            detachElementFromBone(elementWeaponRaplace[source])
            destroyElement(elementWeaponRaplace[source])         
            elementWeaponRaplace[source] = false
        end
  -- Erro abaixo
        if elementBackpack[source] then
            detachElementFromBone(elementBackpack[source])
            destroyElement(elementBackpack[source])
        end
  --
        if elementWeaponBack[source] then
            detachElementFromBone(elementWeaponBack[source])
            destroyElement(elementWeaponBack[source])   
            elementWeaponBack[source] = false
        end 
end
addEvent("kilLDayZPlayer",true)
addEventHandler("kilLDayZPlayer",getRootElement(),removeAttachedOnDeath)

 

if elementBackpack[source] and isElement(elementBackpack[source]) then
	-- ...
end

 

  • Like 1
Link to post

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...