I have a scripted a part to glow and blink when touched, and want a bing sound to come out(also done that)
Problem = The function is repeated more than 1 time in a second
For e.g if you go run over the part, it will produce more than 1 bing sounds and will repeat the function until all parts are off the part. Now I only want the function to be repeated once per 5 seconds and not just spam when ur just standing or moving on it.
local t = 0.15
local s = script.Parent
s.Transparency = 0.5
s.Touched:connect(function(lol)
script.Sound:Play()
wait(t)
s.Transparency = 0.25
s.BrickColor = BrickColor.new("Moss")
wait(t)
s.BrickColor = BrickColor.new("Pastel green")
wait(t)
s.BrickColor = BrickColor.new("Moss")
wait(t)
s.Transparency = 0.5
end)
Take sound Id as 241852639 and please help

1 comment
You should probably also make sure the part touching is a player part.