Thank you for coming to watch this video! Thank you to Omq_Cas for joining me in today's video.
If you like the scripting tutorials, give the video a thumbs up!
NOTICE: This video has an old script that may not work, if done incorrectly. Below, is the script that should work. Anywhere it says "YOURNAME", change that to your Roblox username, with quotes around it. E.g. "rooboo14"
This notice was added 12/21/18 (21/12/18).
local slock = false
game.Players.PlayerAdded:Connect(function(plr)
if slock and plr.Name ~= "YOURNAME" then
plr:Kick("This server is locked!")
end
plr.Chatted:Connect(function(msg)
if plr.Name == "YOURNAME" then
if string.sub(msg,1,6) == ":slock" then
slock = true
elseif string.sub(msg,1,8) == ":unslock" then
slock = false
end
end
end)
end)
![](https://i.ytimg.com/vi/PxIIZlwU2vc/mqdefault.jpg)