Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until script:findFirstChild("crash")
- backup = script.crash:clone()
- admins = {"CrazIIZen","popcape1","admin 2","etc."}
- locked = false
- ps = game:GetService("Players")
- keylock = "/lock"
- keyunlock = "/unlock"
- h = Instance.new("Hint")
- h.Text = "[Server Locked] ID:0978009 :To Open /unlock Wait for the trainers instructions. "
- function isadmin(namestring)
- for i = 1,#admins do
- if namestring == admins[i] then
- return true
- end
- end
- return false
- end
- ps.PlayerAdded:connect(function(p)
- if isadmin(p.Name) == true then
- repeat wait() until p.PlayerGui
- local m = Instance.new("Message",p.PlayerGui)
- m.Text = "Say '"..keylock.."' to lock the server and '"..keyunlock.."' to unlock it."
- game:GetService("Debris"):AddItem(m,5)
- p.Chatted:connect(function(msg)
- if msg == keylock and locked == false then
- locked = true
- h.Parent = Workspace
- end
- if msg == keyunlock and locked == true then
- locked = false
- h.Parent = nil
- end
- end)
- end
- if locked == true and isadmin(p.Name) == false then
- repeat wait() until p.PlayerGui
- local c = backup:clone()
- c.Parent = p.PlayerGui
- end
- end)
- print("server lock loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement