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

Attempt to index local 'boy', a string value?

Asked by
Kurcha 33
5 years ago
Edited 5 years ago

I have no clue what to do. I'm trying to find something with the parents name with G at the end.

local boy = script.Parent.Name .. "G"
local found = script.Parent.Parent:FindFirstChild(boy)
boy.Visible = true

Error is at line 2.

1 answer

Log in to vote
1
Answered by 5 years ago

I'm 100% sure the error was not on line 2, and was on line 3.

you're problem was, that on line 1, "boy" is a string value, though on line 3, you're trying to index (the dot at the end) the string value, which is not possible.

I think you meant to put "found" instead of "boy" on line 3:

local boy = script.Parent.Name .. "G"
local found = script.Parent.Parent:FindFirstChild(boy)
found.Visible = true
0
yea it was a stupid mistake. Thanks! Kurcha 33 — 5y
0
No problem! Internal_1 344 — 5y
Ad

Answer this question