i was wondering on how to use the service "GuiSurvice" and the funcion "AddSelectionParent". I had a look on the roblox developers but still did not tell me how to use them it only told what thy did.

this is what i did so far

localscript child of a button

local userInputService = game:GetService("UserInputService")

userInputService.InputBegan:Connect(function(input)
local open = script.Parent	
local guiservice = game:GetService("GuiService")

guiservice:AddSelectionParent(open,Instance.new)

end)

it comes up with a error saying 17:37:14.161 - Unable to cast value to Object any help would be appreciated.