Jump to content

Attaching Object


Recommended Posts

Posted

How can I add this:

local briefcase = createObject ( 1210, 0, 0, 0 ) 
            exports.bone_attach:attachElementToBone ( briefcase, source, 11, 0, 0, 0, 0, 100, 0 ) 
            function destroy() 
            destroyElement(briefcase) 

And change this:

elseif (itemID==76) then  
            if (briefcase[source]) then  
                destroyElement(briefcase[source]) 
                briefcase[source] = nil 
            else 
                local x, y, z = getElementPosition(source) 
                local rot = getPedRotation(source) 
                 
                x = x + math.sin(math.rad(rot)) * 1.5 
                y = y + math.cos(math.rad(rot)) * 1.5 
                 
                local object = createObject(1631, x, y, z) 
                attachElements(object, source, 0, 1, 0) 
                briefcase[source] = object 
            end 

But I need to change the second code so it works with the first code...

Posted

You just copy and paste some random code not explaining what you need help with so don't expect people answer if they don't know the question.

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