I have this script in StarterCharacterScripts, it sends out a remoteevent which works fine but for some reason the animation won't play.
local Players = game:GetService("Players")
local RStorage = game:GetService("ReplicatedStorage")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Remotes = RStorage:WaitForChild("Remotes")
local Punch = Remotes:WaitForChild("Punch")
local Mouse = Player:GetMouse()
local Animation = script:WaitForChild("Animation")
local CanDamage = true
Mouse.KeyDown:connect(function(Key)
if Key == "f" then
if CanDamage then
CanDamage = false
local Humanoid = Character:WaitForChild("Humanoid")
local PunchAnimation = Humanoid:LoadAnimation(Animation)
PunchAnimation:Play()
Punch:FireServer()
wait(1)
CanDamage = true
end
end
end)

1 comment
I figured it out. The rig was in R6 while the animation was in R15. It's fixed now.