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 make that when Im typing in chat, it wouldn't print "yes" When I click E?

Whenever Im Typing in chat and clicking E it prints "yes", how do I make this not happen?

Script:

local userinput = game:GetService("UserInputService")

userinput.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.E then
		print("yes")
	end
end)

Thank you.

1 answer

✓ Accepted answer

You have to use extra parameters, for example gameProccessedEvent.. This is a true or false parameter. If it is true roblox will think you are interacting with its built in game features. AKA if chatting then it wont print 'yes'... Here the fixed local script. Make sure to put it in StarterCharacterScript:

local userinput = game:GetService("UserInputService")

userinput.InputBegan:Connect(function(input, gameProccessedEvent)
	if gameProccessedEvent then
		return
	end
    if input.KeyCode == Enum.KeyCode.E then
        print("yes")
    end
end)

I've tested it and it works, no errors so there you go!

2 comments

0

Thank you

0

Np glad I could help

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