nick_exe_

Untitled

Sep 25th, 2021 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. local function findPlayer(name)
  2.     for i, player in pairs(game.Players:GetPlayers()) do
  3.         if string.find(string.lower(player.Name), string.lower(name)) then
  4.             return player
  5.         end
  6.     end
  7.    
  8.     return nil
  9. end
  10.  
  11. local prefix = "//"
  12.  
  13. game.Players.LocalPlayer.Chatted:Connect(function(msg)
  14.     local cmd = string.lower(msg)
  15.     local args = string.split(cmd, " ")
  16.    
  17.     if args[1] == prefix .. "setprefix" and args[2] ~= nil then
  18.         prefix = tostring(args[2])
  19.     elseif args[1] == prefix .. "to" and args[2] ~= nil then
  20.         local plr = findPlayer(args[2])
  21.  
  22.         if plr ~= nil then
  23.             game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame = plr.Character:WaitForChild("HumanoidRootPart").CFrame
  24.         else
  25.             print('nicKadmiN | Nil player.')
  26.         end
  27.     end
  28. end)
  29.  
Add Comment
Please, Sign In to add comment