The animation isn't playing. I dont really know what to write in the AnimationId. Anyone know what to do?
local player = game.Players.LocalPlayer
local db = true
local damaged = false
local anim = Instance.new("Animation")
anim.AnimationId = "5218306353"
game.Players.LocalPlayer.Character:WaitForChild("RightHand").Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not db and not damaged and hit.Parent.Humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
if game.Players.LocalPlayer.Character.Humanoid.Health > 0 then
damaged = true
game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid)
end
end
end)
game:GetService("UserInputService").InputBegan:Connect(function(input, event)
if input.KeyCode == Enum.KeyCode.Q and db then
db = false
local playAnim = game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):LoadAnimation(anim)
playAnim:Play()
wait(0.8)
damaged = false
db = true
end
end)

2 comments
try? anim.AnimationId = "rbxassetid://5218306353"
If I understand correctly what you want, just copy the code i posted in my answer below and put it in a local script inside of StarterCharachterScripts (found in StarterPlayer)