* To use random you need to import it prior to using it. It is the best way to import at the beginning of the script:
* No need for the else-part. You're switching between one of the numbers, that will be generated with randint(1, 4). 'i' will never be set to any other number than 1, 2, 3 or 4.
* No need to explicitly 'return true'. You may safely delete that line.
* As far as I know (but I might be wrong), random.random() isn't used as you would like to. It is used without a number in brackets and returns the next random number everytime it is called, which is a number between 0.0 and 1.0
If I'm right, you better use randint(0, 360) here, or, if you explicitly want decimals, random() * 360
* You don't reference an object by creating it. You need to access it using SOL (selected objects list). I can't work with CC at the moment, but I think it is something like
System.Create(o, l, xx, yy)
newobject = SOL.o
newobject.angle = random.random() * 360
If SOL doesn't accept a reference, then you need to create the object by name.