Advertisement
_Thanh_Thy_Cute_

Dollhouse Roleplay BOOMBOX SOUNDBOARD

Aug 5th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. --SOUND KEYS:
  2. --1 – BRUH
  3. --2 – BONK
  4. --3 – OH HE NEED SOME MILK
  5. --4 – DUN DUN DUNNN
  6. --5 – THIS IS A CERTIFIED HOOD CLASSIC
  7. --6 – WHOOMP WHOOMP WHOOMP
  8. --7 – MOM GET THE CAMERA
  9. --8 – RUN IT BACK
  10. local local_player = game.Players.LocalPlayer
  11. local soundboard_id = '7196595323'
  12. local soundboard_data = {
  13. [0.50]='bruh';
  14. [1.00]='bonk';
  15. [1.60]='oh he need some milk';
  16. [5.25]='dun dun dunnn';
  17. [9.17]='this is a certified hood classic';
  18. [12.20]='whoomp whoomp whoomp';
  19. [17.00]='mom get the camera';
  20. [20.80]='Run it back!!';
  21. [21.80]='Run it back!!';
  22. [24.00]='Run it back!!';
  23. [25.00]='Run it back!!';
  24. [27.70]='denied';
  25. }
  26. local ordered_list = {
  27.  
  28. }
  29. for i,v in pairs(soundboard_data) do
  30. table.insert(ordered_list,i)
  31. end
  32. table.sort(ordered_list)
  33.  
  34. local function boom_box()
  35. return local_player.Backpack:FindFirstChild("BoomBox") or (local_player.Character and local_player.Character:FindFirstChild("BoomBox"))
  36. end
  37.  
  38. local function set_boombox_id(boombox,id)
  39. while not boombox.Handle:WaitForChild("Sound").SoundId:match(tostring(id)) do
  40. wait()
  41. boombox.Remote:FireServer("PlaySong",id)
  42. end
  43.  
  44. return
  45. end
  46. local function chat(msg)
  47. game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(msg, "All")
  48. end
  49. local function set_boombox_pos(boombox,pos)
  50. boombox.Handle.Sound.TimePosition = pos
  51. end
  52. local function play_sound(index)
  53. local sound_pos = ordered_list[index]
  54. if not boom_box() then return end
  55. local bb = boom_box()
  56. bb.Parent = local_player.Character
  57. set_boombox_id(bb,soundboard_id)
  58. set_boombox_pos(bb,sound_pos)
  59. bb.Handle.Sound.Playing = true
  60. chat(soundboard_data[sound_pos])
  61. while bb.Handle.Sound.TimePosition < (ordered_list[index+1] or 0) do
  62. game:GetService("RunService").RenderStepped:Wait()
  63. end
  64. bb.Handle.Sound.Playing = false
  65. end
  66. local ek = Enum.KeyCode
  67. local inputs = {
  68. ek.KeypadOne,
  69. ek.KeypadTwo,
  70. ek.KeypadThree,
  71. ek.KeypadFour,
  72. ek.KeypadFive,
  73. ek.KeypadSix,
  74. ek.KeypadSeven,
  75. ek.KeypadEight,
  76. }
  77.  
  78. local uis = game:GetService("UserInputService")
  79.  
  80. uis.InputBegan:Connect(function(input)
  81. local finded = table.find(inputs,input.KeyCode)
  82. if finded then
  83. play_sound(finded)
  84. end
  85. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement