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

How do i solve this FindFirstChild problem?

I have been trying to solve this problem for 2 hours.

Workspace.TycoonModel.Script.MainScript:27: attempt to index nil with 'FindFirstChild'

This is the code:

for i, v in pairs(Buttons:GetChildren()) do local Newitem = Boughtitems:FindFirstChild(v.Item.Value) if Newitem ~= nil then Items[Newitem.Name] = Newitem:Clone() Newitem:Destroy() else v.ButtonPart.Transparecy = 1 v.Button.CanCollide = false end


I don't know what to do at:

local Newitem = Boughtitems:FindFirstChild(v.Item.Value)

Please help! Thank you.

2 comments

0

Can you format your code so I can read it easier.

0

Apparently, Boughtitems is not defined

1 answer

You could use WaitForChild or maybe you didn't define Boughtitems

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