Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i solve this FindFirstChild problem?

Asked by 1 year ago

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.

0
Can you format your code so I can read it easier. manith513 121 — 1y
0
Apparently, Boughtitems is not defined EmK530 143 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago

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

Ad

Answer this question