Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Admins = { -- List of admin usernames
- "ThatDogeDevelopment",
- "Admin2",
- -- Add more admin usernames here
- }
- game.Players.PlayerAdded:Connect(function(player)
- player.Chatted:Connect(function(message)
- local args = string.split(message, " ")
- local isAdmin = false
- for _, admin in ipairs(Admins) do
- if player.Name == admin then
- isAdmin = true
- break
- end
- end
- if isAdmin and #args >= 3 and args[1] == ":kick" then
- local targetPlayer = game.Players:FindFirstChild(args[2])
- local reason = table.concat(args, " ", 3)
- if targetPlayer then
- targetPlayer:Kick(reason)
- game.Players.PlayerAdded:Connect(function(newPlayer)
- if newPlayer.Name == args[2] then
- newPlayer:Kick("You were previously kicked from this server.")
- end
- end)
- else
- print("Player not found!")
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement