Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local commands = {}
- local prefix = ":"
- local admins = {
- "kurtfan5468"
- }
- local function findP(v)
- for i, p in ipairs(game.Players:GetPlayers()) do
- if string.lower(p.Name) == v then
- return p
- end
- end
- return nil
- end
- local function isAdmin(p)
- for _, v in ipairs(admins) do
- if v == p.Name then
- return true
- end
- end
- return false
- end
- commands.tp = function(sender, args)
- print("function fired")
- for _, v in ipairs(args) do
- print(v)
- end
- local PTTN = args[1]
- local PTTTN = args[2]
- if PTTN and PTTTN then
- local PTT = findP(PTTN)
- local PTTT = findP(PTTTN)
- if PTT and PTTT then
- PTT.Character.HumanoidRootPart.CFrame = PTTT.Character.HumanoidRootPart.CFrame
- print("successfully moved")
- end
- end
- end
- commands.sp = function(sender, args)
- print("speed func fired")
- local PTGST = args[1]
- local AOSTG = args[2]
- if PTGST then
- local plr = findP(PTGST)
- if plr then
- plr.Character.Humanoid.Walkspeed = tonumber(AOSTG)
- print("gave speed to: "..plr.Name)
- end
- end
- end
- game.Players.PlayerAdded:Connect(function(p)
- p.Chatted:Connect(function(msg, recip)
- if isAdmin(p) then
- msg = string.lower(msg)
- local split = msg:split(" ")
- local slashCmd = split[1]
- local cmd = slashCmd:split(prefix)
- local cmdName = cmd[2]
- if commands[cmdName] then
- local args = {}
- for i = 2, #split, 1 do
- table.insert(args, split[i])
- end
- commands[cmdName](p, args)
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement