So this is a very like, techical thing, but I switch cameras in my game, and whenever I do the camera module starts spewing out errors and keeps the camera at scriptable and doesnt go back to the humanoid.
But the thing is that it only happens on one specific instance, I copy one model to various locations but this one location bugs out, no other script is affecting anything else just htis script changing. Please help me out here!!!
eventmain.OnClientEvent:Connect(function(eventType,data1,data2,data3,data4)
local player = game.Players.LocalPlayer
if eventType == "changeskybox" then --skybox
game.Workspace.soundstuff.cursong.Volume = 0.3
print("sky:", data1)
for _,i in game.ReplicatedStorage.COOLASSETS.skyboxes[data1]:GetChildren() do
if i.ClassName == "ModuleScript" then
local sets = require(i)
print("twinning rn:")
for v,i in sets do
print("Setting", v, "to", tostring(i))
game.Lighting[v] = i
end
end
end
elseif eventType == "changemusic" then --music
game.Workspace.soundstuff.cursong.SoundId = data1
game.Workspace.soundstuff.cursong:Play()
elseif eventType == "ChangeCameraCustom" then
local Camera = game.Workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = data1
elseif eventType == "ChangeCamera" then
if player.Character and player.Character:FindFirstChild("Humanoid") then
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
game.Workspace.CurrentCamera.CameraSubject = player.Character.Humanoid
task.wait()
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
game.Workspace.CurrentCamera.CameraSubject = player.Character.Humanoid
repeat
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
game.Workspace.CurrentCamera.CameraSubject = player.Character.Humanoid
task.wait()
until game.Workspace.CurrentCamera.CameraType == Enum.CameraType.Custom
and game.Workspace.CurrentCamera.CameraSubject == player.Character.Humanoid
end
elseif eventType == "LinearVelocity" then --handle velocity
local linevelocity = Instance.new("LinearVelocity")
local attach = Instance.new("Attachment")
attach.Parent = player.Character.HumanoidRootPart
linevelocity.Attachment0 = attach
linevelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
linevelocity.LineDirection = player.Character.HumanoidRootPart.CFrame.LookVector
linevelocity.LineVelocity = data1
linevelocity.MaxForce = math.huge
linevelocity.Parent = player.Character
task.wait(data2)
linevelocity:Destroy()
attach:Destroy()
elseif eventType == "RemoveRed" then
if game.Lighting:FindFirstChild("ColorCorrectionLOWHP") then
game.Lighting:FindFirstChild("ColorCorrectionLOWHP"):Destroy()
end
elseif eventType == "KillerChase" then
chase.CreateChase(data1,data2)
end
end)
The one that im looking at is ChangeCamera, I use it to change it from scriptable to Custom, but whenever I do this i get a bunch of errors
tested on multiple people too, please help!

