Right now I am using this script:
local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.Parent.ScreenGui:Clone().Parent = Player.PlayerGui
end)
I don't get any errors. As I think the problem might be that I am clicking the button inside SurfaceGui. Hope someone know how to fix this

2 comments
I think that you need to use a Remote Event.
If you are using a LocalScript inside workspace then it ain't gonna work. put the local script inside Starter player scripts or StarterGui and then run it. define where the UI you want to clone is with a different path. game > Workspace > Wherever it is.