How do I use a string value to check if that value is in the workspace?

Incase I have not worded the title properly, which I am afraid I have not, what I am trying to achieve is by having a name stored inside of a string value. Then, in a script I can check the string value and find a part in the workspace with the same name as the StringValue.

Example of what im trying to achieve:

local SelectedObject = player:WaitForChild("Data"):WaitForChild("SelectedObject")

	if SelectedObject.Value ~= nil then
		SelectedPart = game.Workspace(SelectedObject.Value) --this is where my issue is
1 Like

Try this: