SebTDZ

Music Admin

Jul 21st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. owner.Chatted:connect(function(message)
  2.     local messageLow = string.lower(message)
  3.     if messageLow:sub(1, 7) == ".music " then
  4.         local Id = "rbxassetid://" .. message:sub(8)
  5.         for i,child in pairs(game.Workspace:GetChildren()) do
  6.             if child.ClassName == "Sound" then
  7.                 child:Remove()
  8.             end
  9.         end
  10.         local Music = Instance.new("Sound", workspace)
  11.         Music.SoundId = Id
  12.         Music.Volume = 10
  13.         Music:Play()
  14.     elseif messageLow:sub(1, 5) == ".stop" then
  15.         for i,child in pairs(game.Workspace:GetChildren()) do
  16.             if child.ClassName == "Sound" then
  17.                 child:Remove()
  18.             end
  19.         end
  20.     end
  21. end)
Add Comment
Please, Sign In to add comment