Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local NewDeathSound = 0
- local chara = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
- local RootPart = chara:FindFirstChild("HumanoidRootPart")
- local function AddPitchShift(Sound:Sound)
- local Pitches = {0.8,0.9,1,1.1,1.2}
- local pitch = Instance.new("PitchShiftSoundEffect", Sound)
- pitch.Octave = Pitches[math.random(1,#Pitches)]
- end
- local function ConfigureSound(Sound:Sound)
- Sound.SoundId = "rbxassetid://"..NewDeathSound
- Sound.RollOffMaxDistance = 700
- Sound.Volume = 1
- end
- if RootPart then
- local Found = RootPart:FindFirstChild("Died")
- if Found then
- ConfigureSound(Found)
- AddPitchShift(Found)
- end
- end
- function updatePlayer(plr)
- plr.CharacterAdded:Connect(function(char)
- local RootPart = char:FindFirstChild("HumanoidRootPart")
- if RootPart then
- local Found = RootPart:FindFirstChild("Died")
- if Found then
- ConfigureSound(Found)
- AddPitchShift(Found)
- end
- end
- end)
- if plr and plr.Character then
- local RootPart = plr.Character:FindFirstChild("HumanoidRootPart")
- if RootPart then
- local Found = RootPart:FindFirstChild("Died")
- if Found then
- ConfigureSound(Found)
- AddPitchShift(Found)
- end
- end
- end
- end
- local function e()
- while true do
- wait()
- for _, newplr in pairs(game.Players:GetPlayers()) do
- wait()
- updatePlayer(newplr)
- newplr.CharacterAdded:Connect(function(char)
- local RootPart = char:FindFirstChild("HumanoidRootPart")
- if RootPart then
- local Found = RootPart:FindFirstChild("Died")
- if Found then
- ConfigureSound(Found)
- AddPitchShift(Found)
- end
- end
- end)
- end
- game.Players.PlayerAdded:Connect(function(newplr)
- updatePlayer(newplr)
- end)
- end
- end
- coroutine.wrap(e)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement