I am getting an error on this module script why?

I am getting this errror

Module code did not return exactly one value - Studio
10:20:22.362 Requested module experienced an error while loading - Client - LocalScript:10
10:20:22.363 Stack Begin - Studio
10:20:22.363 Script ‘Players.ZombieKicker7.PlayerScripts.LocalScript’, Line 10 - Studio - LocalScript:10
10:20:22.363 Stack End - Studio

and I don’t know why

here’s my code for my module:

local Dummy = game.Workspace.Rig
local humanoid = Dummy.Humanoid
local animation =     humanoid.Animator:LoadAnimation(game.ReplicatedStorage.gameConfigurations.Animations.OffCouch)

local function Play(animCheck)
    wait()
    animation:Play()
    animation.Stopped:Wait()
    return true
end

and here’s my code for my local script:

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()

local cam = workspace.CurrentCamera
local camPart = game.Workspace.Rig.CameraBone
local dummy = game.Workspace.Rig
local run = game:GetService("RunService")
local animCheck = true

local animation =     require(game.ReplicatedStorage.gameModules.GameStarting.CouchAnimation.CouchAnimation)


cam.CameraType = Enum.CameraType.Scriptable

spawn(function()
    cam.CameraType = Enum.CameraType.Scriptable
	    run.RenderStepped:Connect(function()
	    if not animCheck then
		    cam.CFrame = camPart.CFrame
	    end
    end)
end)

animation.Play(animCheck)

local animation = human:LoadAnimation(game.ReplicatedStorage.gameConfigurations.Animations.OffCouch)

Try this :slight_smile:

Playing an animation from Humanoid is deprecated

Yeah you shouldn’t play animations off the humanoid anymore you have to load animations using the animator but ill try this if it will even work

Nope still gave me an error

Aw. Just out of curiosity, what’s wrong with doing it off the humanoid?

ahhhh I dont know roblox wants you to load animations off the animator now someone told me about it while I was doing some other animations its deprecated but I think I just fixed it

1 Like

Alright I fixed it on my module script I had to make a table then return that table like a default module script