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

How do I get the child of an ObjectValue?

For an example, there's an ObjectValue, the value of it is Player1 which is in workspace. If I want to get Player1's Head through this ObjectValue, how?

print(workspace.ObjectValue.Value.Head) -- Returns error

1 comment

0

Make sure the value is actually set, print the Value first without .Head and see if that doesn't return nil

1 answer

Use string Value with the player name you can do something like this:

local playerName = workspace.StringValue.Value --> Username

local playerHead = workspace:FindFirstChild(playerName).Head  --> Head of username

1 comment

0

I would like to use ObjectValue instead, the example I provide is only an example, in my case, I need to use a ObjectValue, but anyways this have been solved, thanks for helping!

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