Universal Script πŸ“Œ
820 Views
223 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
Luvv9 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 πŸ“Œ
20
0
Approved 24 minutes ago
Script hub
192
991
Bumped 3 hours ago

Script hub

Lunyx Hub

Script hub
120.8k
221.3k
Bumped 3 hours ago
Key System
Script hub
10.7k
201.7k
Bumped 3 hours ago

Script hub

KeylessVerified script badgeIRIDIUM HUB | #1

Script hub
33.3k
300.4k
Bumped 6 hours ago
Script hub
23.8k
5.3k
Bumped 6 hours ago
Key System
Paid
High QualityΒ Offering