I would like to make a dice game and each round I want the dice to respawn in that position ( I already did that ) but with a random orientation, how do I do this?
This is the code I currently have, how do I implement a random orientation?
local dice1 = game.Workspace:FindFirstChild("Dice1")
local dice2 = game.Workspace:FindFirstChild("Dice2")
local victorysound = game.Workspace:WaitForChild("SoundEffects"):WaitForChild("victory")
local startgame = true
while true do
if startgame == true then
startgame = false
if dice1.Anchored == true and dice2.Anchored == true then
dice1.Anchored = false
dice2.Anchored = false
end
wait(7)
dice1.Anchored = true
dice2.Anchored = true
dice1.Position = Vector3.new(4.55, 40.098, -45.091)
dice2.Position = Vector3.new(-34.66, 40.098, -23.891)
end
startgame = true
end