I created a script that makes a humanoid say something when someone comes close, everything works fine, but the problem is that the humanoid is repeated the sound infinite times when a player gets close. I would like him to speak only once and then keep repeating after 5 seconds he finished speaking, can anyone help? another problem is that the sound is played before the event happens, watch the script: script:
local scream = "rbxassetid://292124372"
local works = game:GetService("Workspace")
local hitboxx = works.scream.hitbox
hitboxx.Touched:connect(function(h)
local sound = Instance.new("Sound", hitboxx.Parent.Head)
sound.SoundId = scream
sound:Play()
end)
something wrong?

1 comment
Yeet