I'm trying to make a randomize cube picker and it spawns randomly were the CubePlaces CFrame are, But it didnt work.
The output said something about an nil value.
local CubeDisplays = game.ReplicatedStorage.CubeDisplay:GetChildren()
local CubePlaces = game.Workspace.CubePlaces:GetChildren()
local CubePlacesPart = game.Workspace.CubePlaces
CubeDisplay = math.random(1, #CubeDisplay)
CubeChosen = CubeDisplay[CubeDisplay]
CubeChosen:Clone().Parent = game.Workspace
CubeChosenClone = CubeChosen:Clone()
CubeChosenClone.Parent = game.Workspace
CubePlace = math.random(1, #CubePlaces)
CubeChosenClone.CFrame = CubePlace.CFrame

2 comments
Could you provide the exact output, please?
13:23:45.361 - ServerScriptService.CubeSpawn2:4: attempt to get length of global 'CubeDisplay' (a nil value)