smw94 Posted July 22, 2014 Share Posted July 22, 2014 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
Moderators IIYAMA Posted July 22, 2014 Moderators Share Posted July 22, 2014 failed to call bone_attach resource isn't running? Link to comment
smw94 Posted July 22, 2014 Author Share Posted July 22, 2014 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 IIYAMA Posted July 22, 2014 Moderators Share Posted July 22, 2014 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. Link to comment
roddydennvor Posted October 31, 2014 Share Posted October 31, 2014 if(getResourceState(getResourceFromName("bone_attach")) == "running")then < add this Link to comment
roddydennvor Posted October 31, 2014 Share Posted October 31, 2014 if(getResourceState(getResourceFromName("bone_attach")) == "running")then < add this 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