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

Keys play animations when im typing fix?

I have a punch script inside my game yet when I type in the roblox chat it plays the animations and punches, how do I stop that?

Here's the keycode script I'm using:

UserInputService.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.R and not Punching then

	-- Code that would happen when R is pushed AKA animations and damage

end
end)

2 answers

use userinputservice to activate the animation, using that you can see if they are typing something

1 comment

0

Mm any example, I'm not really familiar with UserInputService and the wiki doesnt help me

UserInputService.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end

2 comments

0

for clearence, IsTyping variable in this case is only true in textboxes and chat and such, which is why i also upvoted

0

oh but does it solve your problem

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