How do i make a random chance?

So i need made a script to get 2 blocks one is red and one is white so you have a 50% chance of getting one of them but sometimes it puts them both

Have you already got a script?

I made it to work so thank you

Yep, something like this could have worked:

local SelectedCube = math.random(1,2)

local function NewPart(Color)
	local Cube = Instance.new("Part")
	Cube.Parent = game.Workspace
	Cube.BrickColor = Color
	Cube.Position = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").Position
end


if SelectedCube == 1 then
	NewPart(BrickColor.new("Red flip/flop"))
else
	NewPart(BrickColor.new("White"))
end

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.