-- Create a dice model with two halves and attach them together local diceModel = Instance.new("Model") diceModel.Name = "ChanceCube" local diceTop = Instance.new("Part") diceTop.Size = Vector3.new(4, 2, 4) diceTop.Position = Vector3.new(0, 1, 0) diceTop.Color = Color3.new(0, 0, 1) diceTop.Parent = diceModel local diceBottom = diceTop:Clone() diceBottom.Position = Vector3.new(0, -1, 0) diceBottom.Color = Color3.new(1, 0, 0) diceBottom.Parent = diceModel local weld = Instance.new("WeldConstraint") weld.Parent = diceModel weld.Part0 = diceTop weld.Part1 = diceBottom -- Put the dice up in the air above the workspace origin (does not require a primary part) diceModel.Parent = workspace diceModel:PivotTo(CFrame.new(0, 10, 0)) -- Assign the primary part before physical simulation -- Without this line, the script will always output the same thing and the bounding box of the model will not change orientation diceModel.PrimaryPart = diceTop -- Wait a bit before rolling the dice (let it settle onto the floor) for i = 5, 1, -1 do print("Rolling dice in...", i) task.wait(1) end -- Roll the dice diceTop:ApplyAngularImpulse(Vector3.new(15000, 1000, 5000)) diceTop:ApplyImpulse(Vector3.new(0, 3000, 0)) task.wait(1) -- Wait for the roll to complete while diceTop.AssemblyLinearVelocity.Magnitude > 0.1 or diceTop.AssemblyAngularVelocity.Magnitude > 0.1 do task.wait() -- Wait 1 frame end -- Get the dice orientation, impacted by the primary part local orientation = diceModel:GetBoundingBox() if orientation.YVector.Y > 0.5 then print("It's the boy!") else print("It's his mother!") end