01 | function addSound() |
02 |
03 | local sounds = script:GetChildren() |
04 | local chosenSound = sounds [ math.random( 1 , #sounds) ] |
05 | local soundCln = chosenSound:Clone() |
06 | soundCln.Parent = script.Parent.Head |
07 | soundCln.Name = "DeathSound" |
08 | soundCln:Play() |
09 |
10 | end |
11 |
12 | if script.Parent.Humanoid.Health = = 0 then |
13 | addSound() |
14 | end |
No errors, nothing. The solution is probably just in my face but I'm not too good with scripting yet. Help would be appreciated.