What do you want to achieve? I want to achieve a timer (the timer counts down from 3 seconds to 0, the timer doesn’t really need any GUI’s, it can’t even be visible to player) system, until the timer runs out, the player must press two buttons (S and W), if the player has time to press them before the timer ends - debouce occurs, if not in time - the script continues.
What is the issue? My stupidness.
What solutions have you tried so far? … none honestly.
How can I make a timer during which the player have to press two buttons?
An 3D Button or An 2D one? what one
Nono, like, a keyboard button .
You may need to use Input Service
local UIS = game:GetService("UserInputService") local plr = game.Players.LocalPlayer local Mouse = plr:GetMouse() local Debounce = false local timer = script.timer.Value timer.Value = 100 (example) repeat timer.Value += 1 UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.S and Input.KeyCode == Enum.KeyCode.W and Debounce == false and timer.Value = <= 0 then print("Pressed V And W") end end)
Thank you!! I was almost desperate really, I will figure out the rest myself, at least i understand the basis now
Its ok, i will improve that code later, bc i am on online class
u made a mistake here it suppose to be
Enum KeyCode.W not Enu.KeyCode.W
Yeahh, thanks for reminding me
Sorry, script error says: Expected (“Until” to close “Repeat” at line 9), got eof; did you forgot to close “=” at line 12? and in the output it says: ServerScriptService.Script:12: Expected ‘then’ when parsing if statement, got ‘=’. What should I do?
Where it says
repeat timer.Value += 1
You need to add an until after that
repeat timer.Value += 1 until
Now the output says: ServerScriptService.Script:12: Expected ‘then’ when parsing if statement, got ‘=’, and the error says: Expected identifier when parsing expression, got ‘then’