I was trying to create ramps that basically stacked cps without tinting em. so u would need to jump from carepackage to carepackage to get up. The problem is that i couldnt get rid of the angle . Heres the code:
Code:
CreateLadders(top, bottom)
{
D = Distance(top, bottom);
blocks = roundUp(D/30);
CX = top[0] - bottom[0];
CY = top[1] - bottom[1];
CZ = top[2] - bottom[2];
XA = CX/blocks;
YA = CY/blocks;
ZA = CZ/blocks;
CXY = Distance((top[0], top[1], 0), (bottom[0], bottom[1], 0));
Temp = VectorToAngles(top - bottom);
BA = (Temp[2], Temp[1] + 90, 20);
for(b = 0; b < blocks; b++){
block = spawn("script_model", (bottom + ((XA, YA, ZA) * b)));
block setModel("com_plasticcase_friendly");
block.angles = BA;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
block = spawn("script_model", (bottom + ((XA, YA, ZA) * blocks) - (0, 0, 5)));
block setModel("com_plasticcase_friendly");
block.angles = (BA[0] , BA[1] - 30, 0);
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
Any advice ? I dont really understand the structure of the code which is why i fail. I just took it from Quarantine Chaos Mapedit.