
781 Views
147 Executions
Leave When Someone Joins
Universal Script 📌
etherheadedFirst script
9 months ago
Please login to perform these actions:Does it work?
No reports yetNo 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.
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









this is actually helpful when i auto farm on dead games that dont have private servers allowed so just incase
1. AI 2. What on earth could this be used for.
@Astric its useful incase you want to be lonely
@gayasf lol
@gayasf just (esc + enter) and its done without scripts this is obviously made by chatgpt and is useless