Someone answered my previous request, but they didn't really touch on what I wanted. Here's the script:
local SS = game.ServerStorage
game.Players.PlayerAdded:Connect(function(plr)
local slocked = SS.Slocked
slocked.Value = false
plr.Chatted:Connect(function(msg)
if msg == "lockserver" and slocked.Value == false then
slocked.Value = true
end
if msg == "unlockserver" then
slocked.Value = false
end
if slocked.Value == true then
plr:Kick("The training center is closed! Please attend it at the scheduled time.")
end
end)
end)

1 comment
Thank you for helping me!