It's a bit more complicated, but you can do it. You need to use something like .tmp to store the color, have a check like: if sim.partProperty(0, "tmp") == 0 then sim.partProperty(0, "tmp", math.random(1,5)) end
This sets .tmp to a random value from 1 to 5 on creation.