Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

NPC's Animation works only in studio and not in game?

Asked by 2 years ago

Hello there. I am trying to make an animation play within my NPC, but it only works when I test the game in studio and not in the actual game. The script is in the NPC and has the animation within it. It also has a folder containing the BoolValues named "Enabled" and "Speed." Script:


--Variables-- local set = script.Settings local sp = set.Speed local enabled = set.Enabled local hum = script.Parent:WaitForChild("Humanoid") if hum then print("Success") else print("No Humanoid") end local humanim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation")) --Playing Animation-- if enabled.Value == true then humanim:Play() humanim.Looped = true humanim:AdjustSpeed(sp.Value) end

Thank you!

Answer this question