I have this which is supposed to play a random sound each time:
local soundtable = {
"1",
"2",
"3",
"4",
"5"
}
...
[Enum.HumanoidStateType.Dead] = function()
stopPlayingLoopedSounds()
math.randomseed(os.clock())
random = math.random(1,5)
playSound((soundtable[random]))
end,
And the error I get is
Players.JLW1009.PlayerScripts.RbxCharacterSounds:77: attempt to index nil with 'TimePosition'

4 comments
This isn't enough to explain your issue. Can you give us the actual code at which the error occurs?
Not really worth it to put the actual code, so I'll just tell you: Basically calls TimePosition = 0 and plays the sound.
Oh, I overlooked. Perhaps the Sound is being created but not parented, or it just doesn't exist. Check your hierarchy.
Actually, I'm just wondering, Can you edit one question and replace it with another?