I made a video to show how its working, Im not sure if is the same effect you trying to do
the part the changes the position while resizing is something like:
addEventHandler("onClientGUIScroll", root, function(element)
setObjectScale(roda,guiScrollBarGetScrollPosition(element)/10)
attachElements(roda,getPedOccupiedVehicle(localPlayer),rodax,roday,rodaz+getElementDistanceFromCentreOfMassToBaseOfModel(roda)*getObjectScale(roda)-getElementDistanceFromCentreOfMassToBaseOfModel(roda))
end)
with roda being the wheel object and rodax,roday,rodaz the attachelements offsets, to make the wheel object rotate with the real wheel I made a onclienprerender event getting the car z rotation and the wheel rotations:
function rodarot()
local vrotx,vroty,vrotz=getElementRotation(getPedOccupiedVehicle(localPlayer))
local rodarx,rodary,rodarz=getVehicleComponentRotation(getPedOccupiedVehicle(localPlayer),"wheel_rf_dummy")
setElementRotation(roda,rodarx,rodary,rodarz+vrotz)
end
this code is not optimized nor checking for warnings/errors, just an example for use in a proper code