I'm trying to aim for the dice to spawn in the same place to roll down a staircase but have a different orientation each time so the result are much more random.
I tried using Vector3 to achieve the same effect, as in "script.parent.Orientation = (X,Y,Z)"
but to no effect on what faces were facing which direction, as they would always spawn in the same orientation (aka, if (and possibly before) the respawn script triggers, whatever face is facing me on top of the staircase will always be the exact orientation on subsequent respawns).
Here is my script inside a part called Dice inside a Model inside Workspace.
The script's Position line works, and it respawns it on top of the staircase after 10 seconds.
The CFrame orientation line however still seems to have a issue (without the SECOND Position line) where it spawns the dice seemingly in the middle of the baseplate.
With the SECOND Position line, it seems to have again no effect like the Vector3 equivalent.
local xPosition = math.random(-179, 179)
local yPosition = math.random(-179, 179)
local zPosition = math.random(-179, 179)
local i = 1
while i < 10 do
script.Parent.Position = Vector3.new(656.713, 548.883, 32.999)
script.Parent.CFrame = CFrame.fromOrientation(xPosition,yPosition,zPosition)
script.Parent.Position = Vector3.new(656.713, 548.883, 32.999)
wait(10)
print ("Loop could be established.")
end
I am still new, and I apologize for any lack of things that should be obvious.
Thank you for reading.

1 comment
I recommend you to use math.random(tick()); at the beginning of your script to have a new random generated seed for each clock tick. That way you do not expect always the same entrophy for the math.random.