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!
