Jump to content

bone_attach help


smw94

Recommended Posts

i'm working on toys resource (something that player can wear but not clothes) like helmet, mask etc, and im using resource bone_attach, but every times i tried to attach the object, its always return "attemp to call a nil value" and "ERROR: toys\s_toys.lua:18: call: failed to call 'bone_attach:attachElementToBone' "

here is part of my code

  
local objectTable = { objBone={} } 
  
function createToyModel(thePlayer, model, bone, x, y, z, rx, ry, rz, scale, doublesided) 
    objectTable.objBone[thePlayer] = {} 
    if not objectTable.objBone[thePlayer][bone] then 
        objectTable.objBone[thePlayer][bone] = createObject(model,0,0,0,0,0,0) 
        if not objectTable.objBone[thePlayer][bone] then 
            outputChatBox("failed",thePlayer) 
        else 
            setObjectScale ( objectTable.objBone[thePlayer][bone], scale) 
            if doublesided then 
                setElementDoubleSided(objectTable.objBone[thePlayer][bone], true) 
            end 
            setElementInterior(objectTable.objBone[thePlayer][bone],getElementInterior(thePlayer)) 
            setElementDimension(objectTable.objBone[thePlayer][bone],getElementDimension(thePlayer)) 
            exports.bone_attach:attachElementToBone(objectTable.objBone[thePlayer][bone],thePlayer,bone,x,y,z,rx,ry,rz) 
        end 
    end 
end 
  

i double checked every variables, but none of them are nil, so whats possibly causing this ? thanks before

Link to comment

no its running, if i put exports.bone_attach:attachElementToBone(objectTable.objBone[thePlayer][bone],thePlayer,bone,x,y,z,rx,ry,rz) client side, its working, i read the resource documentation, its both client and server function, so whats wrong ?

Link to comment
  • Moderators

Well I tried it and it didn't work for me at server too O_o.

The only strange thing is that it did send true back, but there was no result.

Client side did work on the other hand.

But the biggest mystery is that I debugged the code(bone_attach) till the end and should work perfect. :shock:

Link to comment
  • 3 months later...

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