Hey there!
To start off, when dealing with the client, you want to use a local script.
Now that you are using a Local Script. You want to get the player and other GUI's through variables like you already have:
local plr = game.Players.LocalPlayer
local PlayerGui = plr:WaitForChild('PlayerGui')
local Newgui = PlayerGui:WaitForChild('LeaderBoards').CC
local Button = script.Parent
script.Parent.MouseButton1Click:connect(function(player)
script.Parent.Parent:TweenPosition(UDim2.new(10,0,0), "Out", "sine", 3)
end)
Now we have to USE the variables and correct some errors:
local plr = game.Players.LocalPlayer
local PlayerGui = plr:WaitForChild('PlayerGui')
local Newgui = PlayerGui:WaitForChild('LeaderBoards').CC
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
Button.Parent:TweenPosition(UDim2.new(10,0,0,0), "Out", "Sine", 3)
end)
And now with this fixed script, it should work if you got everything correct in terms of variables.
Final Script:
local plr = game.Players.LocalPlayer
local PlayerGui = plr:WaitForChild('PlayerGui')
local Newgui = PlayerGui:WaitForChild('LeaderBoards').CC
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
Button.Parent:TweenPosition(UDim2.new(10,0,0,0), "Out", "Sine", 3)
end)
Hopefully, this has helped you learn from your mistakes.
Best of luck developer!