instance.Touched:Connect(function(Obj)
local h = Obj.Parent:FindFirstChild(“Humanoid”)
if h then
h.Health = 0
local sound = Instance.new(“Sound”,h.Torso)
local i = (ids[math.random(1,#ids)])
sound.SoundId = “http://www.roblox.com/asset/?id=” … i
sound.MaxDistance = 100
sound.Volume = 2
sound:play()
wait(8)
sound:stop()
sound:remove()
end
end)
´´´ 3. I already tried to put an wait() but still din’t work.
ids = {9118147709,6932519682,3571339763,8948378982}
local instance = script.Parent
local playing = false
instance.Touched:Connect(function(Obj)
local h = Obj.Parent:FindFirstChild(“Humanoid”)
if h and playing == false then
playing = true
h.Health = 0
local sound = Instance.new(“Sound”,h.Torso)
local i = (ids[math.random(1,#ids)])
sound.SoundId = “http://www.roblox.com/asset/?id=” … i
sound.MaxDistance = 100
sound.Volume = 2
sound:Play()
task.wait(8)
playing = false
sound:Stop()
sound:Remove()
end
end)