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