I want to add a delay to the touched event, so when it fires it only does one thing, cause at the moment I used it to make this
script.Parent.Touched:Connect(function(plr)
script.Parent.level.Value = script.Parent.level.Value + 1
if script.Parent.level.Value == 1 then
script.Parent.Parent.Transparency = 0.25
script.Parent.Parent.BrickColor = BrickColor.new(213, 115, 61)
elseif script.Parent.level.Value == 2 then
script.Parent.Parent.Transparency = 0.5
end
end)
but it fires like 27 times and results in my script being bassicaly useless.

7 comments
Thanks for your response, but it still doesn't work, it just waits 2 seconds and the numbervalue just goes to 27 again
Nevermind, you edited your message. I'll test it out now.
I did what you recommended, but it still does the same thing, it first goes to 2, then 12 and then 27, and so on, it doesn't fix my question, I tried making the part that activates the script smaller, but it didn't work, I set walkspeed to 33, but it still does not work and does the same thing. Any suggestions?
I'll test this, gimme a minute
Why should it wait if the condition is false?
Solved(And tested)
Works. Thanks for your answer!