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")

SelectedObject.Changed:Connect(function()
	if SelectedObject.Value ~= nil then
		SelectedPart = game.Workspace(SelectedObject.Value) --this is where my issue is
		print(SelectedPart)
	end
end)
1 Like

Try this:

game.Workspace:FindFirstChild(SelectedObject.Value)