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

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

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

✓ Accepted answer

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

2 comments

0

yea it was a stupid mistake. Thanks!

0

No problem!

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