Hey,
I just tried that function and i have a problem now.
If i create the object(which i want to attach to the car) without attaching it to the car, it is on the position where i want it.
But if i create it and attach it right after that, the position is different and i can't even see the object.
This is my code:
addCommandHandler("t",
function ()
local vehicle = getPedOccupiedVehicle ( localPlayer )
if vehicle then
local x,y,z = getPositionFromElementOffset(vehicle,0,3,0)
local rx,ry,rz = getElementRotation(vehicle)
element = createObject(1060,x,y,z,rx,ry,rz,false)
outputDebugString("XYZ:"..x..","..y..","..z)
outputDebugString("RXRYRZ:"..rx..","..ry..","..rz)
attachElements(element,vehicle,x,y,z)
end
end)