Hello developers, I was wondering if it is possible to see if a player has joined the server within the past 5 minutes.
If you are wondering what’s this is for, I am making a server locking system, and if the player disconnects, they can rejoin without having to ask for the host to open the server again.
Here is the system that locks/unlocks the server,
local groupid = 14054990
local Host = 200
local staff = 150
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msgenable)
if msgenable == "!StaffLockOn" then
if plr:GetRankInGroup(groupid) >= Host then
if script.Value.Value == false then
game.ReplicatedStorage.StaffLock:FireAllClients()
script.Value.Value = true
script.Bell:Play()
print("Message Ran")
end
end
end
end)
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msgdisable)
if msgdisable == "!StaffLockOff" then
if plr:GetRankInGroup(groupid) >= Host then
if script.Value.Value == true then
script.Value.Value = false
script.Bell:Play()
end
end
end
end)
end)
game.Players.PlayerAdded:Connect(function(plr)
if script.Value.Value == true then
if plr:GetRankInGroup(groupid) >= staff then
plr:Kick(" AirMayora System | Unfortunatly, we have Staff Locked the server, please join when asked in order to not be late. If you believe this is incorrect, please contact a member of staff.")
end
end
end)