Advertisement
Dsaqwed123

Voice pack

May 7th, 2024
829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LScript 6.47 KB | Gaming | 0 0
  1. game:GetService("RunService").RenderStepped:Connect(change_color)
  2.  
  3. _G.voicepack = "Kiryu" -- Current available voices: "Kiryu", "Akiyama", "Majima" and "Vulcan"
  4. local player = game.Players.LocalPlayer
  5. local character = player.Character
  6. local pgui = player.PlayerGui
  7. local status = player.Status
  8. local RPS = game.ReplicatedStorage
  9. _G.voice = RPS.Voices:FindFirstChild(_G.voicepack)
  10.  
  11. print(_G.voice.Name)
  12. local function playSound(sound)
  13.     local soundclone = Instance.new("Sound")
  14.     soundclone.Parent = character.Head
  15.     soundclone.Name = sound.Name
  16.     soundclone.SoundId = sound.Value
  17.     soundclone.Volume = 0.35
  18.     soundclone:Play()
  19.     soundclone.Ended:Connect(function()
  20.         game:GetService("Debris"):AddItem(soundclone)
  21.     end)
  22. end
  23. local function fetchRandom(instance)
  24.     local instancechildren = instance:GetChildren()
  25.     local random = instancechildren[math.random(1, #instancechildren)]
  26.     return random
  27. end
  28.  
  29.  
  30. local plr = game.Players.LocalPlayer
  31. local pgui = plr.PlayerGui
  32. local interf = pgui.Interface
  33. local bt = interf.Battle
  34. local main = bt.Main
  35.  
  36. local notifyevent
  37. for i,v in pairs (pgui:GetChildren()) do
  38.     if v:IsA("BindableEvent") then
  39.         notifyevent = v
  40.     end
  41. end
  42.  
  43. local function sendNotification(text, color, sound)
  44.     if not color then color = Color3.new(1, 1, 1) end
  45.     pgui.NotifyUI.Awards.ChildAdded:Once(function(c)
  46.         if c.Text == text then
  47.             c.TextColor3 = color
  48.             coroutine.wrap(function()
  49.                 local con;
  50.                 con = game:GetService("RunService").RenderStepped:Connect(function()
  51.                     if not c then
  52.                         con:Disconnect()
  53.                         return
  54.                     end
  55.                     c.TextColor3 = color
  56.                 end)()
  57.             end)()
  58.         end
  59.     end)
  60.     notifyevent:Fire(text, sound or nil)
  61. end
  62.  
  63.  
  64. local alreadyRunning = RPS:FindFirstChild("VoiceMod")
  65. if alreadyRunning then
  66.     sendNotification("Selected voice: ".._G.voice.Name, Color3.fromRGB(255, 255, 255))
  67.     return
  68. end
  69.  
  70. alreadyRunning = Instance.new("BoolValue")
  71. alreadyRunning.Parent = RPS
  72. alreadyRunning.Value = true
  73. alreadyRunning.Name = "VoiceMod"
  74.  
  75. sendNotification("Voice Mod loaded", Color3.fromRGB(255, 255, 255))
  76. sendNotification("Selected voice: ".._G.voice.Name, Color3.fromRGB(255, 255, 255))
  77. local receivedsound
  78.  
  79. player.ChildAdded:Connect(function(child)
  80.     if child.Name == "InBattle" then
  81.         receivedsound = fetchRandom(_G.voice.BattleStart)
  82.         playSound(receivedsound)
  83.     end
  84. end)
  85. local hitCD = false
  86. character.ChildAdded:Connect(function(child)
  87.     if child.Name == "Heated" and child:WaitForChild("Heating",0.5).Value ~= character then
  88.         local isThrowing = child:WaitForChild("Throwing",0.5)
  89.         if not isThrowing then
  90.             receivedsound = fetchRandom(_G.voice.HeatAction)
  91.             playSound(receivedsound)
  92.         end
  93.     end
  94.     if child.Name == "Hitstunned" and not character:FindFirstChild("Ragdolled") then
  95.         if hitCD == false then
  96.             hitCD = true
  97.             receivedsound = fetchRandom(_G.voice.Pain)
  98.             playSound(receivedsound)
  99.             delay(2,function()
  100.                 hitCD = false
  101.             end)
  102.         end
  103.     end
  104.     if child.Name == "Ragdolled" then
  105.         receivedsound = fetchRandom(_G.voice.Knockdown)
  106.         playSound(receivedsound)
  107.     end
  108.     if child.Name == "ImaDea" then
  109.         receivedsound = fetchRandom(_G.voice.Death)
  110.         playSound(receivedsound)
  111.     end
  112.     if child.Name == "Stunned" then
  113.         receivedsound = fetchRandom(_G.voice.Stun)
  114.         playSound(receivedsound)
  115.     end
  116. end)
  117.  
  118. character.ChildRemoved:Connect(function(child)
  119.     if child.Name == "Ragdolled" then
  120.         wait(0.1)
  121.         if not string.match(status.CurrentMove.Value.Name, "Getup") then
  122.             receivedsound = fetchRandom(_G.voice.Recover)
  123.             playSound(receivedsound)
  124.         end
  125.     end
  126. end)
  127.  
  128. character.HumanoidRootPart.ChildAdded:Connect(function(child)
  129.     if child.Name == "KnockOut" or child.Name == "KnockOutRare" then
  130.         child.Volume = 0
  131.     end
  132. end)
  133. local dodgeCD = false
  134. status.FFC.Evading.Changed:Connect(function()
  135.     if status.FFC.Evading.Value == true and character:FindFirstChild("BeingHacked") and not dodgeCD then
  136.         dodgeCD = true
  137.         receivedsound = fetchRandom(_G.voice.Dodge)
  138.         playSound(receivedsound)
  139.         delay(10,function()
  140.             dodgeCD = false
  141.         end)
  142.     end
  143. end)
  144. local fakeTauntSound = RPS.Sounds:FindFirstChild("Laugh"):Clone()
  145. fakeTauntSound.Parent = RPS.Sounds
  146. fakeTauntSound.Name = "FakeLaugh"
  147. fakeTauntSound.Volume.Value = 0
  148. RPS.Moves.Taunt.Sound.Value = "FakeLaugh"
  149. RPS.Moves.RushTaunt.Sound.Value = "FakeLaugh"
  150. RPS.Moves.GoonTaunt.Sound.Value = "FakeLaugh"
  151. status.Taunting.Changed:Connect(function()
  152.     if status.Taunting.Value == true and status.CurrentMove.Value.Name ~= "BeastTaunt" then
  153.         receivedsound = fetchRandom(_G.voice.Taunt)
  154.         playSound(receivedsound)
  155.     end
  156. end)
  157. local lattackCD = false
  158. status.CurrentMove.Changed:Connect(function()
  159.     if string.match(status.CurrentMove.Value.Name, "Attack") or string.match(status.CurrentMove.Value.Name, "Punch") then
  160.         if lattackCD == false then
  161.             lattackCD = true
  162.             receivedsound = fetchRandom(_G.voice.LightAttack)
  163.             playSound(receivedsound)
  164.             delay(0.35, function()
  165.                 lattackCD = false
  166.             end)
  167.         end
  168.     else
  169.         if not string.match(status.CurrentMove.Value.Name, "Taunt") and not string.match(status.CurrentMove.Value.Name, "Grab") then
  170.             receivedsound = fetchRandom(_G.voice.HeavyAttack)
  171.             playSound(receivedsound)
  172.         end
  173.     end
  174. end)
  175.  
  176. game.UserInputService.InputBegan:Connect(function(key)
  177.     if game.UserInputService:GetFocusedTextBox() == nil then
  178.         if key.KeyCode == Enum.KeyCode.H then
  179.             if _G.voicepack == "Kiryu" then
  180.                 _G.voicepack = "Akiyama"
  181.             elseif _G.voicepack == "Akiyama" then
  182.                 _G.voicepack = "Majima"
  183.             elseif _G.voicepack == "Majima" then
  184.                 _G.voicepack = "Vulcan"
  185.             elseif _G.voicepack == "Vulcan" then
  186.                 _G.voicepack = "Kiryu"
  187.             end
  188.             _G.voice = RPS.Voices:FindFirstChild(_G.voicepack)
  189.             sendNotification("Selected voice: ".._G.voice.Name, Color3.fromRGB(255, 255, 255))
  190.         end
  191.     end
  192. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement