It's just a scale value problem :
In the example line : 238
Replace the line by this one :
MyCube=TOK_CreateRBCube(Name$+I,Tmp_Chain,Px#,Py#-SizeHeight#,Pz#,0,Yaw#,0,0.97,0.97,0.97,Mass#,"",255,255,255,1,0)
In the example line : 238
Replace the line by this one :
MyCube=TOK_CreateRBCube(Name$+I,Tmp_Chain,Px#,Py#-SizeHeight#,Pz#,0,Yaw#,0,0.97,0.97,0.97,Mass#,"",255,255,255,1,0)