``lua
local RS = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local events = RS:WaitForChild("Events")
local startComboAnimation = events:WaitForChild("StartComboAnimation")
local M1s = RS:WaitForChild("M1s")
local hum = char:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
if not animator then
animator = Instance.new("Animator")
animator.Parent = hum
end
local function playAnimation(state)
if not state then
warn("State is nil!")
return
end
for _, anim in pairs(M1s:GetChildren()) do
if anim:IsA("Animation") and anim.Name == "M1("..state..")" then
local track = animator:LoadAnimation(anim)
track:Play()
print("Playing animation:", anim.Name)
end
end
end
startComboAnimation.OnClientEvent:Connect(function(state)
playAnimation(state)
end)
``
this is my code and i don't know why it's not plaing the animation