GetUserInput ( angle, "Angle?", "45" )
GetUserInput ( ct, "Crate Number? (2 or 3)", "2" )

if equal("ct,3")
	t = "CRATE1"
	f = "CRATOP2"
else          
	t = "CRATE2"
	f = "CRATOP1"
endif

x = MapX
y = MapY
PointInWhichSector ( sec, x, y )
SectorDuplicate ( sec )
GetSectorProperty ( fh, nSectors, FloorHeight )
SetSectorProperty ( nSectors, FloorHeight, fh + 64 )  
SetSectorProperty ( nSectors, FloorTexture, f )

LineDefFlags = LF_TWOSIDED
LineDefFrontSector = sec
LineDefFrontBelowTexture = t
LineDefBackSector = nSectors

dist = Sqrt ( 64 * 64 / 2 )
RotatePoint ( x1, y1, x, y, dist, angle )
RotatePoint ( x2, y2, x, y, dist, angle + 90 )
RotatePoint ( x3, y3, x, y, dist, angle + 180 )
RotatePoint ( x4, y4, x, y, dist, angle + 270 )
NewLineDef ( x1, y1, x2, y2 )
NewLineDef ( x2, y2, x3, y3 )
NewLineDef ( x3, y3, x4, y4 )
NewLineDef ( x4, y4, x1, y1 )
