I tried to make a script, but for some reason it doesn't work. I don't know why, so I need help.
local localplayer = players.LocalPlayer
local animation = localplayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
script.Parent.Touched:Connect(function(hit)
animation:Play()
end)

2 comments
Is It A Local Script Or A normal Script?
It's normal script