Auto Disconnect
_G.Enabled = true;
_G.CertainPlayer = false; --Set to false if you want it to kick you if anyone joins and true if you want to use playerlist
_G.Kick = true; --If it kicks you or just gives a notification that someone joined
playerlist = {"Name1","Name2","Name3","Name4"} -- Just add more if you want too
--------------------------------------------------------------------------------------SCRIPT
if(_G.Enabled == true) then
game:GetService("Players").PlayerAdded:Connect(function(user)
local Time = os.date("*t")
if(_G.CertainPlayer == false) then
if (_G.Kick == true) then
game.Players.LocalPlayer:Kick("A player joined: "..user.Name.." ,at: "..Time.hour..":"..Time.min)
end
if(_G.Kick == false) then
print(user.name.." Joined your game at ".." ,at: "..Time.hour..":"..Time.min.." and Wrote PlayersJoined.txt file in workspace/AutoDisconnect")
game.StarterGui:SetCore("SendNotification", {
Title = user.name.." Joined!";
Text = "At "..Time.hour..":"..Time.min.." and wrote PlayersJoined.txt in workspace/AutoDisconnect folder";
Duration = 5;
})
makefolder("AutoDisconnect")
writefile("AutoDisconnect\PlayerJoined.txt",
user.name.." joined at "..Time.hour..":"..Time.min
)
end
if(_G.Kick == true) then
game.Players.LocalPlayer:Kick("A player joined: "..user.Name.." ,at: "..Time.hour..":"..Time.min)
end
end
if(_G.CertainPlayer == true) then
for i = 1, #playerlist do
if(user.Name == playerlist[i]) then
if(_G.Kick == true) then
game.Players.LocalPlayer:Kick("A player from the playerlist joined: "..playerlist[i].." ,at: "..Time.hour..":"..Time.min)
end
if(_G.Kick == false) then
print(playerlist[i].." from playerlist Joined your game at ".." ,at: "..Time.hour..":"..Time.min.." and Wrote PlayersJoinedLIST.txt file in workspace/AutoDisconnect")
game.StarterGui:SetCore("SendNotification", {
Title = playerlist[i].." Joined!";
Text = "At "..Time.hour..":"..Time.min.." and wrote PlayersJoinedLIST.txt in workspace/AutoDisconnect folder";
Duration = 5;
})
makefolder("AutoDisconnect")
writefile("AutoDisconnect\PlayerJoinedLIST.txt",
playerlist[i].." from playerlist joined at "..Time.hour..":"..Time.min
)
end
end
end
end
end)
end
_G.CertainPlayer = false; --Set to false if you want it to kick you if anyone joins and true if you want to use playerlist
_G.Kick = true; --If it kicks you or just gives a notification that someone joined
playerlist = {"Name1","Name2","Name3","Name4"} -- Just add more if you want too
--------------------------------------------------------------------------------------SCRIPT
if(_G.Enabled == true) then
game:GetService("Players").PlayerAdded:Connect(function(user)
local Time = os.date("*t")
if(_G.CertainPlayer == false) then
if (_G.Kick == true) then
game.Players.LocalPlayer:Kick("A player joined: "..user.Name.." ,at: "..Time.hour..":"..Time.min)
end
if(_G.Kick == false) then
print(user.name.." Joined your game at ".." ,at: "..Time.hour..":"..Time.min.." and Wrote PlayersJoined.txt file in workspace/AutoDisconnect")
game.StarterGui:SetCore("SendNotification", {
Title = user.name.." Joined!";
Text = "At "..Time.hour..":"..Time.min.." and wrote PlayersJoined.txt in workspace/AutoDisconnect folder";
Duration = 5;
})
makefolder("AutoDisconnect")
writefile("AutoDisconnect\PlayerJoined.txt",
user.name.." joined at "..Time.hour..":"..Time.min
)
end
if(_G.Kick == true) then
game.Players.LocalPlayer:Kick("A player joined: "..user.Name.." ,at: "..Time.hour..":"..Time.min)
end
end
if(_G.CertainPlayer == true) then
for i = 1, #playerlist do
if(user.Name == playerlist[i]) then
if(_G.Kick == true) then
game.Players.LocalPlayer:Kick("A player from the playerlist joined: "..playerlist[i].." ,at: "..Time.hour..":"..Time.min)
end
if(_G.Kick == false) then
print(playerlist[i].." from playerlist Joined your game at ".." ,at: "..Time.hour..":"..Time.min.." and Wrote PlayersJoinedLIST.txt file in workspace/AutoDisconnect")
game.StarterGui:SetCore("SendNotification", {
Title = playerlist[i].." Joined!";
Text = "At "..Time.hour..":"..Time.min.." and wrote PlayersJoinedLIST.txt in workspace/AutoDisconnect folder";
Duration = 5;
})
makefolder("AutoDisconnect")
writefile("AutoDisconnect\PlayerJoinedLIST.txt",
playerlist[i].." from playerlist joined at "..Time.hour..":"..Time.min
)
end
end
end
end
end)
end