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

How do I use a value as a child?

So pretty much I have a value like this for example:

local client = game.ReplicatedStorage.Client.Value

How would I use it like this:

game.Players.--the client value

1 answer

✓ Accepted answer

There are two ways you can come through this problem. One of them is :FindFirstChild() . This will take an input of either a variable, or string (as long as the variable is a string) and will find a child with that name. The other way of doing it, is to use the parent as a table. Eg. game.Players[childName] . In the brackets you would do the same thing as FindFirstChild with the variable or string.

Putting this together, you could use it as:

local client = game.ReplicatedStorage.Client.Value
local plr = game.Players:FindFirstChild(client)

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