I want to make it so when you click on a part it sets your camera to another part. This is the script I have that wont work.
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Camera = workspace.CurrentCamera
function clicked()
Camera.CFrame = workspace.CameraParts.CamPart2.CFrame
end
game.Workspace.Planets.Coruscant.ClickDetector.MouseClick:Connect(clicked)
The thing is, I have this script inside of a GUI text button and it works fine, Please help.