Still have questions? Join our Discord server and get real time help.
0

Wait() doesn't works or works but not properly in RunServices?

RS.RenderStepped:Connect(function()
if KeyHeld == true then
if sec < 10 then
sec = sec + 1
print(sec)
wait(0.5)
end
else
sec = 0
end
end)


basiaclly I'm trying to make some kind of held down key triggers where it checks for how long it being held down in 0.5 seconds, but for some reason wait(0.5) doesn't works in here and it just adds 1 to sec immediately without waiting

0
wait() does not work like that WideSteal321 707 — 9d
0
explain please SuAkihiro 72 — 9d
0
cause I need to fix it SuAkihiro 72 — 9d
0
suakihiro renderstepped fires 60 times a second aka every 0.0166 s it fires, meaning ur above function will be called 60 timse a second, ur wait does literally nothing it doesnt yield the next renderstepped that is called VerdommeMan 1162 — 9d