Failing to detect if player is chatting

So I’ve been trying to detect if a player is typing so I can determine if they can fire the event or not, but for some reason the script does not seems to work, except for when I remove the “if not chat then” line any ideas?

game:GetService("UserInputService").InputBegan:connect(function(input, chat)
	if not chat then
		if Dropping.Value == true then
			if input.KeyCode == Enum.KeyCode.X then
				rEvent:FireServer('q',true)
				print("w")
			end;

			if input.KeyCode == Enum.KeyCode.C then
				rEvent:FireServer('Down',true)
				print("e")
			end;
		end
	end
end)

Maybe try this?

game:GetService("UserInputService").InputBegan:connect(function(input, Typing)
	if not Typing then return end
		if Dropping.Value == true then
			if input.KeyCode == Enum.KeyCode.X then
				rEvent:FireServer('q',true)
				print("w")
			end;

			if input.KeyCode == Enum.KeyCode.C then
				rEvent:FireServer('Down',true)
				print("e")
			end;
		end
	end
end)

use this

game:GetService("UserInputService").InputBegan:connect(function(input, chat)
	if chat then return end
		if Dropping.Value == true then
			if input.KeyCode == Enum.KeyCode.X then
				rEvent:FireServer('q',true)
				print("w")
			end;

			if input.KeyCode == Enum.KeyCode.C then
				rEvent:FireServer('Down',true)
				print("e")
		end;
	end
end)

issue on your if statement

if NOT typing then return end

that means it won’t work if they’re not typing

I tried it, It doesn’t work :(((
Do you know any work-around for this?

game:GetService("UserInputService").InputBegan:connect(function(input, Typing)
	if Typing then return end
		if Dropping.Value == true then
			if input.KeyCode == Enum.KeyCode.X then
				rEvent:FireServer('q',true)
				print("w")
			end;

			if input.KeyCode == Enum.KeyCode.C then
				rEvent:FireServer('Down',true)
				print("e")
			end;
		end
	end
end)

Try this instead. I had a typo in a previous post of mine, sorry.

I just checked and the script I have actually doesn’t have “not” in it. I have 0 clue how that got there.

does anything cause an error in the script at all?

try this

game:GetService("UserInputService").InputBegan:Connect(function(key, isTyping)
	if isTyping then return end
		if Dropping.Value == true then -- where is Dropping? do you have a variable for it above this part of the script?
            key = key:lower()
			if key == 'x' then
				rEvent:FireServer('q',true) -- picking this up in a server script?
				print("w")

			elseif key == 'c' then
				rEvent:FireServer('Down',true) -- assuming you're picking this up in a server script too?
				print("e")
		
       end
	end
end)