Need help about coding a animation

Just wanted code about:

First One:
I want the dummy keep playing animation for while.

Second One:
I want to make when the player touch a part. The dummy will start playing another animation. and waits like 0.5 seconds the animation will be stopped.

Just edited the post…

I’m really sorry but you haven’t tested it, I can hardly understand you, and you explain things quite weirdly.

I have no idea what you are saying! This post makes no english! Please explain clearly what you want and show your code!!!

!!!

I was typing fast! my bad. you can read up now

I’m sorry, but #help-and-feedback:scripting-support is for help, not for asking an entire script. However, I can give you some basic code:

local debounce = true
local dummy = script.Parent
local animator = Instance.new("Animator")
animator.Parent = dummy:WaitForChild("Humanoid")
local anim1 = animator:LoadAnimation(animation) --Insert your first animation
local anim2 = animator:LoadAnimation(animation2) --Insert your second animation
local part = --the part
anim1:Play()
anim1.Looped = true
part.Touched:Connect(function(hit)
   if debounce then
      debounce = not debounce
      anim1:Stop()
      anim2:Play() --Starts other animation
      task.wait(0.5)
      anim2:Stop()
      debounce = true
   end
end)

Ok! Thank you very much.
The reason why i can’t code right now. cause…
The pc is not ready right now…

This is why…