I’m having an issue with making an animation play
This is the code in a main script
local NPC = NPCFolder:FindFirstChildOfClass("Model")
local HRP = NPC:FindFirstChild("HumanoidRootPart")
local FraudDocDecision = math.random(1,2)
local DocumentsFolder = NPC.Documents
local CorrectDocID = DocumentsFolder:GetAttribute("Correct")
local IncorrectDoc1ID = DocumentsFolder:GetAttribute("FraudOne")
local IncorrectDoc2ID = DocumentsFolder:GetAttribute("FraudTwo")
local VIPTicket = DocumentsFolder:GetAttribute("VIPTicket")
local LoR = math.random(1,2)
local Animation1
local Animation2
if LoR == 1 then
print("1")
Animation2 = NPC.Animate.PointL
Animation1 = NPC.Animate.PocketL
elseif LoR == 2 then
print("2")
Animation2 = NPC.Animate.PointR
Animation1 = NPC.Animate.PocketR
end
NPC.HumanoidRootPart.Anchored = false
print(Animation1)
print(Animation2)
print(Animation1.AnimationId)
print(Animation2.AnimationId)
print(NPC)
print(NPC.Humanoid)
local animationTrack1 = NPC.Humanoid:LoadAnimtaion(Animation1)
print("Animation1Play")
animationTrack1:Play()
animationTrack1.Stopped:Wait()
local animationTrack2 = NPC.Humanoid:LoadAnimation(Animation2)
print("Animation2Play")
animationTrack2:Play()
animationTrack2.Stopped:Wait()
NPC.HumanoidRootPart.Anchored = true
All the prints print out everything which i’d expect but the animation just doesn’t play. The animations priority’s are also action.
If you could help out it would be amazing.