local animTrack = game.Workspace.UFO.Humanoid:LoadAnimation(UFO)
local UFOmodel = game.Workspace.UFO
local MaleVoiceover = game.Workspace.Sound.MaleVoiceover
local UFOPart = script.Parent
local function ResumeAudio()
print("Touched!")
wait(.1)
MaleVoiceover:Resume()
animTrack:Play()
wait(9)
UFOmodel:Destroy()
end
UFOPart.Touched:Connect(ResumeAudio)```
Nothing seems wrong to me, I am however a bit unfamiliar with LoadAnimation, have you tried put a print right after that to see if even that runs? I can’t see why any of the other things shouldn’t run.
According to the documentation you need to reference an animation object, you’ve just put “UFO”
https://developer.roblox.com/en-us/api-reference/function/Humanoid/LoadAnimation
example=Humanoid:LoadAnimation(script.Parent.AnAnimation)
example:Play()
Put the animation path instead of just UFO
Humanoid:LoadAnimation()
is deprecated, try using The animator, e.g :
local animator = Humanoid:WaitForChild("Animator")
local track = animator:LoadAnimation(animation_instance)
if you dont have an Animator
instance parented to UFO Humanoid, Make one.
That works, but if you actually open the link you sent, it Said in red rext : This function is deprecated for the favor of Animator
just a couple of proof to back me up :
https://developer.roblox.com/en-us/api-reference/function/Humanoid/LoadAnimation
If it’s a local script it won’t run.
Local scripts don’t run in workspace.
If it’s a server script, make sure the part you touch is exactly UFOPart.