Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I fix this error that I get when I test the game?

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

2 answers

✓ Accepted answer

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

2 comments

0

Well, it works, but the debounce doesn't, ha.

0

If it fixes your problem then mark this as the solution, if your script doesnt work then you can make a new question for fixing it if you dont know how to

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 :)) .

This discussion is preserved as it was. New answers, comments, and votes are closed.