The link to my animation:
I used the id 12494820540 from the url above
This is my code:
local mineAnim = Instance.new("Animation")
mineAnim.AnimationId = "rbxassetid://12494820540"
local function playAnim(character, animation)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
-- need to use animation object for server access
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local animationTrack = animator:LoadAnimation(animation)
animationTrack:Play()
print("play")
return animationTrack
end
end
end
game.ReplicatedStorage.RE.OnServerEvent:Connect(function(plr)
playAnim(plr.Character,mineAnim)
end)
The owner of the animation is my friend though, but I don’t think that’s the problem. When I ran the code, it printed “play” but nothing happened to my character. What’s the problem here? Is it the wrong ID? Or is there a problem with my code?
