Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Players.PlayerAdded:connect(function(plr)
- glockActivate = false
- debounce = false
- local function showMessage(message)
- if debounce == false then
- debounce = true
- local hintScreenGui = Instance.new("ScreenGui", plr.PlayerGui)
- hintScreenGui.Name = "hintScreenGui"
- local hintFrame = Instance.new("Frame", plr.PlayerGui.hintScreenGui)
- hintFrame.Name = "hintFrame"
- hintFrame.BackgroundColor = BrickColor.new(0, 0, 0)
- hintFrame.BackgroundTransparency = 0.3
- hintFrame.Position = UDim2.new(-0.1, 0, 0.1, 0)
- hintFrame.Size = UDim2.new(0, 0, 0.1, 0)
- local notificationSound = Instance.new("Sound", plr.PlayerGui.hintScreenGui)
- notificationSound.SoundId = "rbxassetid://205310435"
- notificationSound:Play()
- hintFrame:TweenSize(UDim2.new(1.2, 0, 0.1, 0), "Out", "Quad", 2)
- local glockText = Instance.new("TextBox", plr.PlayerGui.hintScreenGui.hintFrame)
- glockText.Name = "glockText"
- glockText.BackgroundTransparency = 1
- glockText.BorderSizePixel = 0
- glockText.Size = UDim2.new(1, 0, 1, 0)
- glockText.Font = 5
- glockText.Text = ""
- glockText.TextColor3 = Color3.fromRGB(255, 255, 255)
- glockText.TextScaled = true
- local text = message
- wait(2)
- for i = 0, #text do
- glockText.Text = string.sub(text, 1, i)
- wait()
- end
- wait(2)
- local glockTextTransparency = 0
- while glockTextTransparency < 1 do
- glockTextTransparency = glockTextTransparency + 0.05
- glockText.TextTransparency = glockTextTransparency
- wait()
- end
- local backgroundTransparency = 0.3
- while backgroundTransparency < 1 do
- backgroundTransparency = backgroundTransparency + 0.05
- hintFrame.BackgroundTransparency = backgroundTransparency
- wait()
- end
- plr.PlayerGui.hintScreenGui:Destroy()
- debounce = false
- end
- end
- plr.Chatted:connect(function(msg)
- if plr:GetRankInGroup(groupID) >= minimumRankGlockActivate then
- if msg == "-glock on" then
- if debounce == false then
- if glockActivate == false then
- glockActivate = true
- game.Players.PlayerAdded:connect(function(plr)
- for _,v in pairs (game.Players:GetChildren()) do
- if v:GetRankInGroup(groupID) < minimumRankGlockAvoidance then
- plr:Kick("This server is group locked.")
- end
- end
- end)
- if plr:GetRankInGroup(groupID) < minimumRankGlockAvoidance then
- plr:Kick("The server is group locked.")
- end
- showMessage("The server has been group locked!")
- end
- end
- elseif msg == "-glock off" then
- if debounce == false then
- if glockActivate == true then
- glockActivate = false
- showMessage("The server has been unlocked!")
- end
- end
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement