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

Clicking keys while chat bar is open activates my script?

How do I make it so that while a player is chatting in the game chat, it won't activate a script that involves a key press?

1 answer

✓ Accepted answer

Hi Wolf,

UserInputService comes with two parameters. The first one is the UserInput object, and the second is the game processed event. Just check that game processed event isn't true.

####Like this:

local uis = game:GetService("UserInputService");

uis.InputBegan:Connect(function(obj, gp)
	if obj.KeyCode == Enum.KeyCode.Q and not gp then -- The 'not gp' part makes sure that it wasn't a game processed event, as in it wasn't clicked while typing.
		-- Whatever
	end
end)

##Well, I hope I helped and have a wonderful day/night.

Thanks,

Best regards,

~~ KingLoneCat

2 comments

0

Yo lone cat teach me how to make text big

0

What do u mean?

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