So I have this script for an NPC, where the animation loops over and over on the server. The script worked perfectly fine for a while. Suddenly, I go to test it today, and the animation is not playing. The script is within ServerScriptService.
local animation = Instance.new("Animation", script.Parent) animation.AnimationId = "rbxassetid://5412563718" local Endo = workspace:WaitForChild("Backroom Endo") local AT = Endo.Humanoid:LoadAnimation(animation) while true do AT:Play() AT.Stopped:wait() end
The only thing I've changed since is adding a menu Gui, but I don't see how that would affect this? If anyone can spot anything wrong, then thank you!
Well, I would like you to use AnimationTrack.Looped
property of the Animation Track. The following illustrates how you can use it.
local animation = Instance.new("Animation", script.Parent) animation.AnimationId = "rbxassetid://5412563718" local Endo = workspace:WaitForChild("Backroom Endo") local AT = Endo.Humanoid:LoadAnimation(animation) AT.Looped = true AT:Play()
If you need more information, you can go to this page to learn more: https://developer.roblox.com/en-us/api-reference/property/AnimationTrack/Looped
Lemme know if it helps!