Hiya, I'm trying to trigger a remote event if the player does not press "q" within 5 seconds. I currently have this and I was wondering how I could make it so that if "Alert" doesn't stop playing before 5 seconds then it triggers the remove event. Thanks
repeat wait() until script.Parent.Alert.IsPlaying == false
I would suggest making a variable that counts each second, then when the player presses Q you detect if that variable is 5 or more. OR just add a timer for 5 seconds, and if it has passed 5 seconds, you just not allow the player to press Q. Can't really give you a proper answer because of lack of the information, sorry.
Well you can do
local number = 0 repeat wait() number = number +1 until script.Parent.Alert.IsPlaying == false or number == 5
Thanks for the help but I've decided to work around this instead since the system I intended would be tricky for new players