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
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.
You need to do something like this:
player.PlayersArmor:FindFirstChild("SelectedValue").Parent = player.Character.Armor
This is because you can't use WaitForChild on a property, which is what you were doing with SelectedValue.Value
.
Should be a simple fix, hope this helped.