Advertisement
4zx16

Part Music Player Command

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