You’re calling :Connect and inputting the output of the function which i can see that its nil.
the proper way to connect functions is as the following:
game.Players.PlayerAdded:Connect(onPlayerAdded) -- let the function be referenced instead of called
wait(1)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CameraUtil = require(ReplicatedStorage.CameraUtil)
local functions = CameraUtil.Functions
local shakePresets = CameraUtil.ShakePresets
local cameraInstance = workspace.CurrentCamera
local camera = CameraUtil.Init(cameraInstance)
local function onPlayerAdded(player)
print("a")
camera:MoveTo(game.Workspace.part1)
camera:PointTo(game.Workspace.part2)
camera:SetFOV(70)
end
game.Players.PlayerAdded:Connect(onPlayerAdded)
-- ...
local Player = game.Players.LocalPlayer
local function onPlayerAdded() -- use the Player variable
camera:MoveTo(game.Workspace.part1)
camera:PointTo(game.Workspace.part2)
camera:SetFOV(70)
end
onPlayerAdded()