I’m no expert, but you could use variables defined before it to reduce its length. Otherwise, to me it seems like it’s as short as it can be.
An example of variables that could be set here are the CFrame.Angles and the Vector3.new used.
The CFrame seems long because the values you are using are from a variable, not just an integer. You have to name the variable each time, so it will be long, but that is okay. As long as it works well.
I know I can do that but I am more concerned with neat vertical code formatting, and that solution would cost me some extra lines, which would make it messy.
You could probably shorten the rotation part by writing: newItem.Root.CFrame.Rotation * CFrame.Angles(0, math.random(0, 3)*math.pi/2, 0)
CFrame.Rotation just simply returns the rotation component of the CFrame, multiplying it the rotation above will rotate the original CFrame around the Y axis
Thanks for sharing this solution, it’s exactly what I needed. But upon checking, I noticed that the orientation changes relative to the part instead of the world, which isn’t what I had in mind, the script doesn’t work as intended anymore. Any solutions for this problem?