---
title: "Leave When Someone Joins | Universal Roblox Script - ScriptBlox"
description: "Leave When Someone Joins for any Roblox game: You can choose to automatically leave the game if players are currently detected in your server, or if..."
canonical_url: "https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957"
meta:
  "og:description": "Leave When Someone Joins for any Roblox game: You can choose to automatically leave the game if players are currently detected in your server, or if..."
  "og:image": "https://scriptblox.com/images/script/0-1769240170516.jpg"
  "og:title": "Leave When Someone Joins | Universal Roblox Script - ScriptBlox"
  "twitter:description": "Leave When Someone Joins for any Roblox game: You can choose to automatically leave the game if players are currently detected in your server, or if..."
  "twitter:image": "https://scriptblox.com/images/script/0-1769240170516.jpg"
  "twitter:title": "Leave When Someone Joins | Universal Roblox Script - ScriptBlox"
---

> Index of every page on this site: [llms.txt](https://scriptblox.com/llms.txt)

![Universal Script 📌](https://scriptblox.com/images/script/0-1769240170516.jpg)

# **Leave When Someone Joins**

[**Universal Script 📌**](https://scriptblox.com/game/universal)**![etherheaded](https://scriptblox.com/images/photo/68ce4dac5100bcf3f3ef8ca6-1758350881791.png) [etherheaded](https://scriptblox.com/u/etherheaded)Lv 6First script**

10 months ago

[**Get an executor**](https://scriptblox.com/executors?kind=executor)

Please login to perform these actions:

## **Does it work? **

**No reports yet **

No reports yet. Tried it? Be the first to say.

Also noticed:

## Description

You can choose to automatically leave the game if players are currently detected in your server, or if players join leater.

## **Updates **

1. Jan 24, 2026

   ****Script edited:**** Update script

[View Raw](https://scriptblox.com/raw/Universal-Script-Leave-When-Someone-Joins-90957)

```
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer

-- Toggles
local kickIfAlreadyInServer = true   -- kicks if someone is already in server
local kickOnPlayerJoin = true        -- kicks if someone joins later

if kickIfAlreadyInServer then
	for _, player in ipairs(Players:GetPlayers()) do
		if player ~= localPlayer then
			localPlayer:Kick("Another player is already in the server.")
			return
		end
	end
end

if kickOnPlayerJoin then
	Players.PlayerAdded:Connect(function(player)
		if player ~= localPlayer then
			localPlayer:Kick("Another player joined the server.")
		end
	end)
end


```

## **Comments **

**5**

Log in to join the conversation. [**Login **](https://scriptblox.com/login?redirect=/script/Universal-Script-Leave-When-Someone-Joins-90957)

![Luvv's profile picture](https://scriptblox.com/images/user-default.webp)

[**Luvv**](https://scriptblox.com/u/Luvv)9 months ago

this is actually helpful when i auto farm on dead games that dont have private servers allowed so just incase

2

![zivoria's profile picture](https://scriptblox.com/images/photo/64ec64fa4f538af76763524a-1792922289306.png)

[**zivoria**](https://scriptblox.com/u/zivoria)Lv 1210 months ago

1\. AI 2. What on earth could this be used for.

2

![gayasf's profile picture](https://scriptblox.com/images/photo/690be0100cb27af8f150a014-1768430734389.png)

[**gayasf**](https://scriptblox.com/u/gayasf)10 months ago

[@Astric](https://scriptblox.com/u/Astric) its useful incase you want to be lonely

1

![Nothing\_sam's profile picture](https://scriptblox.com/images/photo/6970ed5b83690c59c1fa38d6-1770042658229.jpg)

[**Nothing\_sam**](https://scriptblox.com/u/Nothing_sam)10 months ago

[@gayasf](https://scriptblox.com/u/gayasf) lol

1

![skidsense's profile picture](https://scriptblox.com/images/photo/691379646ab6abde7a50dad0-1768647890201.jpg)

[**skidsense**](https://scriptblox.com/u/skidsense)10 months ago

[@gayasf](https://scriptblox.com/u/gayasf) just (esc + enter) and its done without scripts this is obviously made by chatgpt and is useless

1

```json
{"@context":"https://schema.org","@type":"SoftwareSourceCode","@id":"https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957#script","url":"https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957","name":"Leave When Someone Joins","programmingLanguage":"Lua","runtimePlatform":"Roblox","author":{"@type":"Person","name":"etherheaded","url":"https://scriptblox.com/u/etherheaded"},"datePublished":"2026-01-24T07:36:10.529Z","image":"https://scriptblox.com/images/script/0-1769240170516.jpg","isAccessibleForFree":true}
```

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scriptblox.com/#website","@type":"WebSite","description":"Search free Roblox scripts uploaded by the community, with live status for every major executor. Browse by game, copy the loadstring and run it in your executor.","inLanguage":"en","name":"ScriptBlox","url":"https://scriptblox.com/"},{"@id":"https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957#webpage","@type":"WebPage","description":"Leave When Someone Joins for any Roblox game: You can choose to automatically leave the game if players are currently detected in your server, or if...","name":"Leave When Someone Joins | Universal Roblox Script - ScriptBlox","url":"https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957","breadcrumb":{"@id":"https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957#breadcrumb"},"isPartOf":{"@id":"https://scriptblox.com/#website"},"mainEntity":{"@id":"https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957#script"},"potentialAction":[{"@type":"ReadAction","target":["https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957"]}]},{"@id":"https://scriptblox.com/script/Universal-Script-Leave-When-Someone-Joins-90957#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://scriptblox.com","position":1},{"@type":"ListItem","name":"Universal","item":"https://scriptblox.com/game/universal","position":2},{"@type":"ListItem","name":"Leave When Someone Joins","position":3}]}]}
```

## Sitemap

See the full [sitemap](https://scriptblox.com/sitemap.md) for all pages.
