I was wondering why it doesnt server lock if i type in the command? Note this is not a free model i wrote playername for convenience and because i wasn't sure if i was still gonna use player name i just wanted to be specific instead of people asking me why u didnt put in the variable. Please don't label this as a free model I really need help because I've been trying and I can't seem to get it to work.
local slock = false
local admin = "playername"
local Player = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
if plr.Name == admin and slock == true then
plr:kick("Server is Locked")
print("locked")
else
if slock == false
then
print("unlocked")
wait()
end
end
plr.Chatted:Connect(function(Message)
if string.lower(string.sub(Message, 1 , 5)) == "slock" and Player.Name == admin then
slock = true
else
if string.lower(string.sub(Message, 1 , 6)) == "unslock" and Player.Name == admin then
slock = false
end
end
end)
end)
