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
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
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
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.
1 comment
Make sure the value is actually set, print the Value first without
.Headand see if that doesn't return nil