Jump to content

bone_attach


Drakath

Recommended Posts

I'm using the bone_attach resource and I keep getting errors since MTA 1.4:

WARNING: bone_attach\bone_attach_c.lua:79: Bad argument @ 'setElementPosition' [Expected number, got NaN]

WARNING: bone_attach\bone_attach_c.lua:80: Bad argument @ 'setElementRotation' [Expected number, got NaN]

I did this but it still gives me the errors.

if tonumber(objx) and tonumber(objy) and tonumber(objz) and tonumber(offrx) and tonumber(offry) and tonumber(offrz) then 
setElementPosition(element,objx,objy,objz) 
setElementRotation(element,offrx,offry,offrz,"ZXY") 
end 

Link to comment

I also had this problem, then someone told me how to fix it, this is the code:

if (not tonumber(tostring(objx)) or not tonumber(tostring(objy)) or not tonumber(tostring(objz))) then return end 
if (not tonumber(tostring(offrx)) or not tonumber(tostring(offry)) or not tonumber(tostring(offrz))) then return end 

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