I can't find information anywhere about this so I wanted to ask you guys to see if you know how to do it.
COMMUNITY QUESTION
How to you make a animation play on a dummy when you touch a part?
1 answer
you’re gonna have to use the Touched event using this
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Dummy = game.Workspace.dummy
Dummy.Touched:Connect(function(hit)
if hit.Parent == Character:FindFirstChild(“Humanoid”) then
local Animation = Instance.new(“Animation”)
Animation.AnimationId = “animation id”
local humanoid = Character:WaitForChild(“Humanoid”)
local AnimationTrack = humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

58 comments
Thank you.
ExCaliberDen the dummy should be what the dummy was called. And if this answered your question please make it an answer
Yes it did, thank you.
oh
How do you make it show like that, to make it look like a script because i can't post everything. i think i"m doing it wrong.
what do you mean?
Sorry im kinda new to coding so were do you set the animation to play during the script?
Also hit and humanoid are being registered as unknown even tough they aren't.
ohhh let me edit it
Thank you, and if i have to ask you anything else i'm sorry.
ask me anything!
Ok.
on the AnimationId, you should put the ID pf your animation
of*
Got it
Are these “ soused to be "?
I'm sorry again, but i touched the dummy and the script didn't work...
what does the error say? Check the output
It doesn't show any errors, but it says something is wrong with this line local Character = Player.Character or Player.CharacterAdded:wait()
Got it.
tell me if there are more errors
It still says there is something wrong with the same line.
did you put the right spaces, capitalization and spellings?
also did you put local Character = Player.Character or Player.CharacterAdded:Wait()
Put exactly what you put, and everything seemed to be capitalized.
Wait()
oh
Did that but still seems to say that something on the line is wrong.
i used it on mine, works
how
were do you put the script?
Wait did you change the “ to a " or do i keep it like “
in StarterPlayerScripts using a Local Script
Sorry still isn't working
also yes change the quotation marks
well did that didn't work, but it's saying it can't find the value of local Dummy = game.Workspace.dummy
did you put in the name of your dummy? instead of putting dummy
would i have to switch everything that is dummy to whatever the name is?
no just change this, local Dummy = game.Workspace.[name of your dummy]
Oh ok
can you update the script to show me what your's looks like?
ok done
FindFirstChild, and WaitForChild are switched.
yeah
oh
we have reached 40+ comments
How is yours working and mine not?
World record.
idk. I just typed it
i don't know what the problem is considering yours works and I did exactly what the script was so do you want to give up?
im so sorry if i couldn’t help you. But feel free to ask more questions
Its ok and sure.
anything else?
50 COMMENTS!
Nothing.
Also 3 hours wasted out of our life.
Well i did learn more so i guess it wasn't wasted.
guys lets try to get the most commented section ever