Hello everyone, I am an absolute beginner at scripting, so I apologize for my very basic question. I am attempting to add multiple custom death sounds to my game so that a random sound ID will play for each death. However, I’m only able to add to get one working at a time. I basically want 25 death sounds in the game, and when the player dies, it pulls one at random to play. How would I do this? Can I simply add the sound IDs to my current script or do I need to add something extra? This is my script so far:
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
function ChangeDeathSound()
local Character = Player.Character or Player.CharacterAdded:Wait()
local DiedSound = Character.PrimaryPart:FindFirstChild("Died")
if DiedSound then
DiedSound.SoundId = "rbxassetid://5646824941"
end
end
I appreciate any feedback, and thank you for being patient with us coding noobs