Attempt to index nil 'clone' (line 9)

local SpawnRoller = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvents"):WaitForChild("SpawnRoller")

local Rollers = game:GetService("ReplicatedStorage"):WaitForChild("Rollers")

local RollerSpawns = workspace:WaitForChild("RollerSpawns")

SpawnRoller.OnServerEvent:Connect(function(plr, Roller)
	
	local ClonedRoller = Rollers:FindFirstChild(Roller):Clone()
	ClonedRoller.Parent = workspace:WaitForChild("RollerStorage")
	
	ClonedRoller.CFrame = CFrame.new(RollerSpawns:GetChildren()[math.random(1,#RollerSpawns:GetChildren())].Position)
	
end)

I’ve tried waiting until the folder has every object it should have but nothing works

Error: local ClonedRoller = Rollers:FindFirstChild(Roller):Clone()

add if not Rollers:FindFirstChild(Roller) then return end a line before the ClonedRoller

Still nothing spawns

extra text…

local ClonedRoller = Rollers:FindFirstChild(Roller):Clone()

Have you tried enclosing (Roller) with quotes?

local ClonedRoller = Rollers:FindFirstChild(“Roller”):Clone()

FindFirstChild expects a string input, not an instance

The issue is that for some reason only 3 rollers are rendered within the game engine and idk what is causing this

whats the another script of the roller?

`local plr = game.Players.LocalPlayer

local RollButton = script.Parent.Roll

local LatestRollerLabel = script.Parent.LatestRoller

local MultiChanceLabel = script.Parent.MultiChance

local Rollers = {
	["Common"] = 65;
	["Uncommon"] = 42;
	["Rare"] = 30;
	["Epic"] = 23;
	["Legendary"] = 13;
	["Mythic"] = 5;
	["Godly"] = 0.7;
	["Black Hole"] = 0.1;
}

local function ChooseRoller()
	
	local totalProbability = 0

	for roller, chance in pairs(Rollers) do
		
		totalProbability = totalProbability + chance
		
	end

	local randomValue = Random.new():NextNumber(0,totalProbability)

	for roller, chance in pairs(Rollers) do
		
		randomValue = randomValue - chance

		if randomValue <= 0 then
			
			return roller
			
		end
		
	end

	return nil
	
end

local SpawnRoller = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvents"):WaitForChild("SpawnRoller")

local db = false

local RollerColors = {
	["Common"] = Color3.fromRGB(85, 255, 91);
	["Uncommon"] = Color3.fromRGB(69, 208, 74);
	["Rare"] = Color3.fromRGB(29, 89, 255);
	["Epic"] = Color3.fromRGB(114, 0, 171);
	["Legendary"] = Color3.fromRGB(239, 184, 56);
	["Mythic"] = Color3.fromRGB(255, 0, 0);
	["Godly"] = Color3.fromRGB(255, 255, 127);
	["Black Hole"] = Color3.fromRGB(17, 17, 17);
}

local function SetLatestRollerLabelColor(LatestRoller)
	
	for roller, color in pairs(RollerColors) do
		
		if roller == LatestRoller then
			
			return color
			
		end
		
	end
	
end

RollButton.MouseButton1Click:Connect(function()
	
	if db == false then
		
		db = true
		
		local ChosenRoller = ChooseRoller()
		
		SpawnRoller:FireServer(ChosenRoller)
		
		LatestRollerLabel.Text = ChosenRoller
		
		LatestRollerLabel.TextColor3 = SetLatestRollerLabelColor(ChosenRoller)
		
		task.wait(1)
		
		db = false
		
	end
	
end)`

The issue is that for some reason Roblox is not rendering the objects into the folder and only 3 of the objects get rendered (the same 3 each time)

it just means that the Roller variable, which i guess is a string doesnt match any instance names in the Rollers Folder. which will return nil and nil can’t use Clone().