When I test the game, this appears in the output:
15:25:56.297 - Players.MinecraftButterfly87.PlayerGui.LocalScript:14: Expected ')' (to close '(' at line 8), got <eof>
This is what's in the scipt:
local debounce = false local player = game.Players.LocalPlayer local mouse = player:GetMouse() if debounce == false then debounce = true --Now your code will not run, because debounce is not false. mouse.KeyDown:connect(function(key) if key == "e" then print("Pressed e") wait(5) debounce = false --Now your code will run again. end) end
I believe you missed an end
, use the script i fixed for you
Use this:
local debounce = false local player = game.Players.LocalPlayer local mouse = player:GetMouse() if debounce == false then debounce = true --Now your code will not run, because debounce is not false. mouse.KeyDown:connect(function(key) if key == "e" then print("Pressed e") wait(5) debounce = false --Now your code will run again. end end) end
To start, insert a LocalScript
in StarterGui
.
Inside of the LocalScript
type this:
local keydown = false game:GetService("UserInputService").InputBegan:Connect(function(key, GPE) keydown = true if key.KeyCode == Enum.KeyCode.E and not GPE then print("Pressed e") end end)
When you press e, the game will print "Pressed e".
If this did work, please mark this as the solution. If you were looking for something else, please comment on this answer what you specifically want and I'll try to make it :)) .