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 convience and because i wasnt sure if i was still gonna use playername i just wanted to be specific

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)

1 comment

0

Obvious free model .. All you have to do is configure the admin variable.