Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What do i do abotu attempt to index nil with 'Clone'?

so im making a simple shop and ive ran into a problem. im trying to test if the gears will appear in guis named template. when i test it i get this error:Players.ManChild266.PlayerGui.Shop.LocalScript:8: attempt to index nil with 'Clone'.

heres my code:local folder = game.ReplicatedStorage:WaitForChild("Tools")

local frame = script.Parent:WaitForChild("Frame")

local temnplate = frame:WaitForChild("Template")

for _, tool in pairs(folder:GetChildren()) do local newTemplate = template:Clone() newTemplate.Name = tool.Name newTemplate.ObjectName.Text = tool.Name newTemplate.Visible = true newTemplate.Parent = frame end

1 answer

On the line where you state the template variable you spelled it wrong and said "temnplate". Change it to "template".

Hope this helped. Also use codeblock in the next question you ask.

This discussion is preserved as it was. New answers, comments, and votes are closed.