-- assuming that the obj variable was created earlier in the script
local cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true)
-- attaches the camera to the object rotated 90 degrees and offset 10 x values
HardAttachCamToEntity(cam, obj, 0.0, 0.0, 90.0, 10.0, 0.0, 0.0, true)
-- renders the camera
RenderScriptCams(true, false, 0, true, true)