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

Help with keypress events please? [UNANSWERED]

So I'm as you can see a rookie at KeyDown events, I'd like some help with playing animations could someone give me some help on how to play an animation on keypress?

Here's the script:

Player = game.Players.LocalPlayer

tool = script.Parent

tool.Equipped:Connect(function(mouse)
	
mouse.KeyDown:Connect(function(key)
	
	   if key == "e" then
		
		local anim = instance.new("Animation")
	   
	   
	   end
end)

3 Questions Where would the parent be of the animation so the script can play? How do you play the animation? How do you debounce it so it isn't spammable?

1 comment

0

Instance.new() **

1 answer

Hmmm.... Maybe Like This. (Use it in LocalScripts!) (Just Answer The Questions, Not The Script) Q1. The Parent A1. The Humanoid Q2. Play It? How? A2. The Lines Below.

local animthing = Humanoid:LoadAnimation(yourAnimation)
animthing:Play()

Q3. How To Debounce It? A3. wut iz debounce?

3 comments

0

Why Did I Get A -1?

0

Because you have to be sure with your answer, you don't just give out guesses this is scripting helpers.

0

Oh Thanks, From Now On I Will Answer Surely.

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