Advertisement
4zx16

Part Music Player Command (Gamepass)

Dec 18th, 2021 (edited)
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16, @PurpleCrystella || PART MUSIC PLAYER COMMAND (GAMEPASS)
  3. ]]
  4. local MPS = game:GetService("MarketplaceService")
  5. local Sound = script.Parent.Sound
  6. local id = 0
  7.  
  8. game.Players.PlayerAdded:Connect(function(player)
  9.     player.Chatted:Connect(function(msg)
  10.  
  11.         if MPS:UserOwnsGamePassAsync(player.UserId, id) then
  12.             if string.sub(msg,1,5) == "!play" then
  13.                 Sound.SoundId = "rbxassetid://"..string.sub(msg,6)
  14.                 Sound.Volume = 10
  15.                 wait(1)
  16.                 Sound:Play()
  17.                 wait(Sound.TimeLength)
  18.                 Sound:Stop()
  19.             end
  20.         end
  21.     end)
  22. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement