Amazingranma261

MyOwnDamnAdmin

Nov 24th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. print("Admin Loaded")
  2.  
  3. __doctype__ = "Roblox Local Script"
  4. __author__ = "Izzy"
  5. __version__ = 2
  6.  
  7. PLAYER = game.Players.LocalPlayer
  8. mySound = Instance.new("Sound")
  9. CHARACTER = PLAYER.Character
  10. ASSET_LINK = "http://www.roblox.com/asset/?id="
  11. CONTENT_PROVIDER = game:GetService("ContentProvider")
  12. TOKEN = "#"
  13. script.Parent = PLAYER
  14. function preloadAsset(id)
  15.     CONTENT_PROVIDER:Preload(ASSET_LINK..id)
  16. end
  17.  
  18. function playAudio(id,vol,pitch)
  19.     preloadAsset(id)
  20.    
  21.     if mySound.IsPlaying == true then
  22.         mySound:Stop()
  23.     end
  24.    
  25.     mySound.Parent = CHARACTER:FindFirstChild("Head")
  26.     mySound.SoundId = ASSET_LINK..id
  27.     mySound.Volume = vol
  28.     mySound.Pitch = pitch
  29.     mySound:Play()
  30. end
  31.  
  32. function getPlayer(name)
  33.     if name:lower() == "me" then return PLAYER end
  34.     for i,v in pairs(game.Players:GetChildren()) do
  35.         if v.Name:lower():match(name:lower()) then
  36.             return v
  37.         elseif name:lower() == "all" then
  38.             return v
  39.         else
  40.             return nil
  41.         end
  42.     end
  43. end
  44.  
  45. function p(m,c)
  46.     if m:lower():match(TOKEN..c) then
  47.         return true
  48.     else
  49.         return false
  50.     end
  51. end
  52.  
  53. PLAYER.chatted:connect(function(m)
  54.     timeSinceLastSpoke = time()*10000
  55.     if p(m,"ping") then
  56.         print("Pong - "..((time()*10000)-timeSinceLastSpoke))
  57.     elseif p(m,"play ") then
  58.         newId = m:sub(7)
  59.         playAudio(newId,1,1)
  60.     elseif p(m,"deepclean") then
  61.         for i,v in pairs (workspace:GetChildren()) do
  62.             v:Remove()
  63.         end
  64.         for i,v in pairs (game.Lighting:GetChildren()) do
  65.             v:Remove()
  66.         end
  67.     elseif p(m,"clean") then
  68.         for i,v in pairs (workspace:GetChildren()) do
  69.             if v:IsA("Model") then return end
  70.             v:Remove()
  71.         end
  72.     elseif p(m,"respawn") then
  73.         v= m:sub(10)
  74.         p0 = getPlayer(v)
  75.         p0:LoadCharacter()
  76.     elseif p(m,"tp") then
  77.         v = m:sub(5)
  78.         p0 = getPlayer(v)
  79.         CHARACTER:MoveTo(p0.Character:FindFirstChild("Head").Position)
  80.     end
  81. end)
Advertisement
Add Comment
Please, Sign In to add comment