Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- put in ServerScriptService
- -- credits to alvinblox
- local commands = {}
- local admins = {
- "Dubleey" -- put your name here
- }
- local prefix = ">" -- put your prefix here
- local function findPlayer(name)
- for i, player in pairs(game.Players:GetPlayers()) do
- if string.lower(player.Name) == name then
- return player
- end
- end
- return nil
- end
- local function isAdmin(player)
- for _, v in pairs(admins) do
- if v == player.Name then
- return true
- end
- end
- return false
- end
- commands.zoom = function(sender, arguments) -- this is tp command, put whatever you wanna name it after commands.
- print("tp function fired by"..sender.Name)
- for _, playerName in pairs(arguments) do
- print(playerName)
- end
- local playerToTeleportName = arguments[1]
- local playerToTeleportToName = arguments[2]
- if playerToTeleportName and playerToTeleportToName then
- local plrToTP = findPlayer(playerToTeleportName)
- local plrToTPTo = findPlayer(playerToTeleportToName)
- if plrToTP and plrToTPTo then
- plrToTP.Character.HumanoidRootPart.CFrame = plrToTPTo.Character.HumanoidRootPart.CFrame
- print("succysessy")
- end
- end
- end
- commands.speed = function(sender, arguments) -- this is speed command, put whatever you wanna name it after commands
- print("speedcmd done by"..sender.Name)
- local playerToGiveSpeedTo = arguments[1]
- local amountOfSpeedToGive = arguments[2]
- if playerToGiveSpeedTo then
- local plr = findPlayer(playerToGiveSpeedTo)
- if plr then
- plr.Character.Humanoid.WalkSpeed = tonumber(amountOfSpeedToGive)
- end
- end
- end
- game.Players.PlayerAdded:Connect(function(player)
- player.Chatted:Connect(function(message,recipient)
- if isAdmin(player) then
- message = string.lower(message)
- local splitString = message:split(" ")
- local arrowCommand = splitString[1]
- local cmd = arrowCommand:split(prefix)
- local cmdName = cmd[2]
- if commands[cmdName] then
- local arguments = {}
- for i = 2, #splitString, 1 do
- table.insert(arguments,splitString[i])
- end
- commands[cmdName](player,arguments)
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement