Leave When Someone Joins
Key RequiredUniversal

Leave When Someone Joins

Universal Scriptetherheadedetherheaded 760 views 108 executesUpdated Jan 24, 2026
0.0/ 5(1 votes)
010% Positive
Lua Script•23 lines (620 chars)
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

Features & Information

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

Community Comments (5)

xyrevexxyrevexJan 24, 2026

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

Replying to @xyrevex
gayasfgayasfJan 24, 2026

@Astric its useful incase you want to be lonely

Replying to @gayasf
Nothing_samNothing_samJan 24, 2026

@gayasf lol

Replying to @gayasf
skidsenseskidsenseJan 24, 2026

@gayasf just (esc + enter) and its done without scripts this is obviously made by chatgpt and is useless

LuvvLuvvMar 14, 2026

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

More Scripts for Universal Scripts