-- Script
1 | game.ReplicatedStorage.ChangeCam.OnServerEvent:Connect( function (player) |
2 | game.Workspace.CurrentCamera.CameraType = "Custom" |
3 | end ) |
-- LocalScript
1 | playframe.ep 1. TextButton.MouseButton 1 Click:Connect( function () |
2 | game.ReplicatedStorage.ChangeCam:FireServer() |
3 | end ) |
CameraType value won't change.
You cant change the camera on the server like that, heres what you should do from a local script, since youre clicking on a GUI Object.
1 | --Local script |
2 |
3 | repeat workspace.Camera.CameraType = Enum.CameraType.Scriptable; wait() |
4 | until workspace.Camera.CameraType = = Enum.CameraType.Scriptable |
5 |
6 | script.Parent.MouseButton 1 Click:Connect( function () --an image button |
7 | workspace.Camera.CameraType = Enum.CameraType.Custom |
8 | end ) |
Hers a gif of what happens: https://gyazo.com/c5398b59c7f8e29024f7ca90f226bd62