Camera script is still breaking

Probably the third post i made about this stupid script but
when joining the server it doesnt put my camera move my camera whatsoever and its stuck at the spawn place

not sure if this is only for the first person that loads in the server or any others after.

repeat S = pcall(function() game:GetService("StarterGui"):SetCore("ResetButtonCallback", false) end) task.wait(0.1) until S 

-- Varibles
local Player = game:GetService("Players").LocalPlayer
local Players = game:GetService('Players')
local Camera = game.Workspace.CurrentCamera
local LobbyCam = game.Workspace.LobbyCam 
local MenuCam = game.Workspace.MenuCam
local CamChangeEvent = game.ReplicatedStorage.Events:WaitForChild("ChangeCamera")
local CamChangeSTLEvent = game.ReplicatedStorage.Events:WaitForChild("ChangeCam")

-- Functions
local function ChangeCam(Cam)
	if Cam == "Menu" then
		Camera.CFrame = MenuCam.CFrame
	end
	
	if Cam == "Lobby" then
		Camera.CFrame = LobbyCam.CFrame
	end
	
	if Cam == "Extras" then
		-- Soon(tm)
	end
end

-- Main
local Character = Player.Character or Player.CharacterAdded:Wait()
repeat Camera.CameraType = Enum.CameraType.Scriptable; task.wait(0.01) until Camera.CameraType == Enum.CameraType.Scriptable
ChangeCam("Menu")
CamChangeEvent.Event:Connect(ChangeCam)

script.Sound:Play()
script.Sound.Looped = true

Are you sure CamChangeEvent is a RemoteEvent? If it’s a BindableEvent, Then you must fire it after connecting it into the function and listen to it’s Event signal.

Otherwise if it’s a RemoteEvent, You should listen to the OnClientEvent signal. (And also send which type of camera you want to switch to on the Server)

Note that BindableEvents can’t be fired on the Server and then listened on the Client. (and vice-versa)

-- Case it's a RemoteEvent and we're on Server...
CamChangeEvent:FireClient(Player, "Menu")

-- Otherwise, If it's a BindableEvent and we're on Client...
CamChangeEvent:Fire("Menu")

yeah its a bindable event, and it works normally its just not changing camera in this script for some reason

when the camera is broken and the event is fired, it just turns the camera another way for some reason, doesnt even move it

Change camera type to scriptable and CFrame in a loop.

2 Likes