How to run a local script without the player?

So basically, I’m doing an playerless script, but It has to delete the player in the server, and how can a local script run without being in local player.

Any scripts will help!

local scripts can’t run without a player, they are designed to be client sided scripts.

But can local scripts run in a player’s client? Even when the player is deleted

You mean when character is deleted? Scripts in startergui should still be running since they are not in the character.

No, I mean the player, in players service.

Oh nvm I misread your question.

It can’t, a local script can only run in the character, and the player. It can’t run anywhere else and since the player is destroyed so does the character. Meaning there is no ancestor where the script can be ran.

An alternative would be to delete the player on all the other clients

local function DeletePlayer(player)
  for _, v in pair(game.Players:GetPlayers() do
    if v ~= player then
      DeletePlayerRemote:Fire(v, player)
    end
  end
end