Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Keys play animations when im typing fix?

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
1
Answered by 4 years ago

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

0
Mm any example, I'm not really familiar with UserInputService and the wiki doesnt help me adamson239 12 — 4y
Ad
Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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

0
for clearence, IsTyping variable in this case is only true in textboxes and chat and such, which is why i also upvoted Gameplayer365247v2 1055 — 4y
0
oh but does it solve your problem themaxogamer 58 — 4y

Answer this question