Hello there. So recently, I made a post needing some help on randomized pitch for the “Oof” death sound. This was successful, but the problem is it stays the same pitch, and did not change to a random pitch value like I thought it would. I tried doing this thing where I had an intvalue that changed to a random number when the player died, but it did not work, and did not replace the pitch value. Does anyone have an idea how to randomize the sound on death, rather than it being the same every time a player character is added?
Thanks much.
Can you send the script please? Of how you worked out on it.
By sending the script, I could explain your mistakes.
Well anyway, here’s the solution:
script.Parent.HumanoidRootPart:WaitForChild("Died")
script.Parent.HumanoidRootPart.Died.PlaybackSpeed= math.random(1,100)/100
Where is that script located in ?
I forgot to add that this has to be a localscript.
1 Like
Sorry about that I was in a rush to post this as I had to do something but I deleted the script, but basically what I did is had an intvalue that was set to math.random, which would be the playbackspeed value, then I had a humanoid.died function that would set its value to a random number again, but it did not work after multiple tries tweaking it, but thank you anyway for the help
Well there you go, this is a localscript that has to be added into
repeat wait() until script.Parent.HumanoidRootPart:findFirstChild("Died")
script.Parent.HumanoidRootPart.Died.PlaybackSpeed= math.random(1,500)/100
function plradded(plr)
plr.CharacterAdded:connect(function(char)
plr.Character.HumanoidRootPart.Died.PlaybackSpeed= math.random(1,500)/100
end)
if plr.Character then
plr.Character.HumanoidRootPart.Died.PlaybackSpeed= math.random(1,500)/100
end
end
game.Players.PlayerAdded:Connect(plradded)
for i,v in pairs(game.Players:GetPlayers()) do
task.spawn(plradded,v)
end
1 Like
I also would like to add, to use waitForChild in that script, since it isn’t working to 100% yet.
This is just making the sound pitch when you respawn and someone else respawns but if you check the console it says that HumanoidRootPart not found if someone dies.
alright ill make sure to change that thanks again