Yesqueendev

Admin Commands (NOT FE)

Jan 17th, 2020
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local char = plr.Character
  3. local mouse = plr:GetMouse()
  4.  
  5. local function isnumber(thingy)
  6.     if type(thingy) == "number" then
  7.         return true
  8.     else
  9.         return false
  10.     end
  11. end
  12. local function findplayer(g)
  13.             local thing = nil
  14.             local stringtosearch = g
  15.             for i, v in ipairs(game.Players:GetChildren()) do
  16.             local stringwesearchin = v.Name
  17.             local search = string.match(stringwesearchin,stringtosearch)
  18.             if search then
  19.                 thing = v
  20.             end
  21.             end
  22.                 return(thing)
  23.             end
  24. local function disco(targetpart)
  25. while wait(0.2) do
  26.      targetpart.Color = Color3.new(math.random(1,255),math.random(1,255),math.random(1,255))
  27.    
  28.     end
  29. end
  30. local function anchor(targetpart)
  31.     if targetpart.Anchored == true then
  32.         targetpart.Anchored = false
  33.     else
  34.         targetpart.Anchored = true
  35.     end
  36. end
  37.  
  38.  
  39.  
  40. --main script
  41. plr.Chatted:Connect(function(msg)
  42.     if msg == "/discopart" then
  43.         if mouse.Target == nil then
  44.         else
  45.             disco(mouse.Target)
  46.         end
  47.        
  48.     elseif msg == "/anchorpart" then
  49.             if mouse.Target == nil then
  50.         else
  51.             anchor(mouse.Target)
  52.         end
  53.     elseif msg:sub(1,9) == "/respawn " then
  54.         local thingy = findplayer(msg:sub(10))
  55.         if thingy == nil then
  56.                       thingy:LoadCharacter()
  57.                 end
  58.     elseif msg:sub(1,13) == "/destroychar " then
  59.         local gamer = findplayer(msg:sub(14))
  60.         if gamer == nil then
  61.         else
  62.             gamer.Character:Destroy()
  63.         end
  64.     end
  65. end)
Advertisement
Add Comment
Please, Sign In to add comment