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

FindFirstChild() not working when I put in a StringValue.Value?

When I use FindFirstChild() and input a StringValue.Value into the "()" it returns nil even tho I the value says there is something in the value. The error says that the FindFirstChild() can not index a nil value even tho I checked the player's gui while the game is running and have a print statement and the print statement says there is something in the value and then for some reason the FindFirstChild() with the value does not work and returns nil. pls help

print(SelectedValue.Value)
player.PlayersArmor:FindFirstChild(SelectedValue.Value).Parent = player.Character.Armor

2 answers

if the print line works


print(SelectedValue.Value) 


and you checked the value it prints is identical to the name you see while the game is running, the only possibility of this error is when this line is called

player.PlayersArmor:FindFirstChild(SelectedValue.Value).Parent = player.Character.Armor 

your PlayersArmor has not been loaded yet, put in wait(10) or wait(50) to make sure it works, then reduce the timer.

1 comment

0

Please don't do that ^

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