Random spawn point each time

I’m trying to make it so that every time player dies or resets, he spawns on one of the random checkpoints and the player’s camera is at specific position looking at the character. But my current scripts don’t seem to work, am I doing something wrong?

Local script in starter character scripts:

local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local event = game.ReplicatedStorage.Events.Spawn

player.CharacterAdded:Connect(function(char)
	print("spawned")
	event.FireServer(char, camera)
end)

Regular script in server script service:

local Players = game:GetService("Players")
local event = game.ReplicatedStorage.Events.Spawn

local Spawns = game.Workspace.SpawnPoints:GetChildren()

event.OnServerEvent:Connect(function(player, char, camera)
	print("spawned")
	local spawn = Spawns[math.random(1, #Spawns)]
	char.HumanoidRootPart.CFrame = spawn.CFrame + Vector3.new(0, 3, 0)
	camera.CFrame = spawn.CFrame + Vector3.new(-6, 6, 0)
end)

The output shows nothing, there seem to be no errors, and I am assuming that the CharacterAdded event isn’t firing at all

Turn the player script into a local character script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local character = script.Parent
local camera = workspace.CurrentCamera
local event = ReplicatedStorage.Events.Spawn

print("spawned")
event:FireServer(character, camera)

Edit: The issue could also be that you indexed event.FireServer() even though im pretty sure it’s event:FireServer()

I quickly tested my theory about .FireServer and sure enough, using a period to index caused a syntax error, use :FireServer instead.

I tried that, and for me it didn’t work for some reason. But your first solution did.

Also very important, with your RemoteEvent, exploiters will be able to teleport any character to a random spawn at any moment, you need to add a check to compare the remote sender to the character they parsed