Universal Script 📌
801 Views
188 Executions

Leave When Someone Joins

Universal Script 📌
etherheaded
etherheadedFirst script
10 months ago
Get an 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. Script edited: Update script

View Raw
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
Luvv's profile picture
Luvv8 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
zivoria10 months ago

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

2
gayasf's profile picture
gayasf10 months ago

@Astric its useful incase you want to be lonely

1
Nothing_sam's profile picture
Nothing_sam10 months ago

@gayasf lol

1
skidsense's profile picture
skidsense10 months ago

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

1

More universal scripts

See all
Universal Script 📌
2.3k
6.9k
Bumped 5 hours ago
Script hub
5.7k
85.5k
Bumped 5 hours ago

Script hub

SAGAZx Hub

Script hub
77.5k
272.9k
Bumped 5 hours ago
Key System
Script hub
506
21
6 hours ago

Script hub

Verified script badgeIridium Hub

Universal Script 📌
1.1M
472.0k
Bumped 8 hours ago
Script hub
5.6k
11.6k
Bumped 9 hours ago

Script hub

swimhub