Error makes no sense PT2

Hello.
I’m getting a error from my module scripting talking about "Its not finding the function “LoadAnim” and im confused why its not. Please help.

Module1 =

local TA = {}
--
local U1 = nil
--
function TA.LoadAnim(P1,P2)
	while not U1 do
		task.wait()
	end
	--
	local V1 = Instance.new('Animation',U1)
	V1.AnimationId = 'rbxassetid://' .. P2
	return U1:LoadAnim(V1)
end
--
function TA.Init(P3)
	P3.Player.CharacterAdded:Connect(function(P4)
		U1 = P4:WaitForChild('Humanoid')
	end)
	P3.Player.CharacterRemoving:Connect(function()
		U1 = nil
	end)
end
--
return TA

Module2 =

local TA = {}

-- Services --
local Replicated = game:GetService('ReplicatedStorage')
local Players = game:GetService('Players')
--
local U2 = false
--

-- Dive Powers --
local Powers = {
	Normal = {
		Linear= 2.25, 
		Vertical = 2.5, 
		Rotation = 0.125
	},
	InAir = {
		Linear= 1.7, 
		Vertical = 7, 
		Rotation = 0.092
	}
}
--
local Anims = {
	Block = 10002476971
}
--
local PAnims = {}
--

-- Functions --
function TA.GetUp()
	local Player = Players.LocalPlayer
	local Character = Player.Character
	local Humanoid = Character:WaitForChild('Humanoid')
	--
	U2 = false
	Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
	Humanoid.PlatformStand = false
	task.wait(0.5)
	Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,true)
end
--
function TA.Dive(P1,P2)
	local Player = Players.LocalPlayer
	local Character = Player.Character
	local Humanoid = Character:WaitForChild('Humanoid')
	local RootPart = Character:FindFirstChild('HumanoidRootPart')
	--
	U2 = true
	Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,false)
	local V1 = not Humanoid.Jumping and Powers.Normal or Powers.InAir
	P2 = P2 or Humanoid.MoveDirection * Humanoid.WalkSpeed
	--
	RootPart.AssemblyLinearVelocity = Vector3.new(V1.Linear * P2.X,V1.Vertical,V1.Linear * P2.Z)
	RootPart.AssemblyAngularVelocity = Vector3.new(P2.Z,0,-P2.X) * V1.Rotation
	Humanoid.PlatformStand = true
end
--
function TA.Block()
	local Player = Players.LocalPlayer
	--
	if not PAnims.Block then
		PAnims.Block = Player.PlayerScripts.Animate:LoadAnim(Anims.Block)
	end
	--
	if Player.Character:FindFirstChild('Values').CanBlock.Value then
		Anims.Block:Play()
		return
	end
	Anims.Block:Stop()
end
--
TA.Actions = function(P3,P4)
	if P4 == Enum.UserInputState.Begin then
		if P3 == 'Dive' then
			if not U2 then
				TA.Dive()
			end
		end
		task.wait(3)
		TA.GetUp()
		--
		if P3 == 'Block' then
			if not U2 then
				TA.Block()
			end
		end
	end
end
--
return TA

No error that I know of is:

Can you provide a screen shot?

You’re looking for LoadAnim in a nil/humanoid. Are you sure it’s meant to do that?

image

It looks like its trying to find a child. Did you add the parenthesis and the require()?

I tried using require and it gave me the same error

Can i see the script using the function? I think it would help

That makes no sense since LoadAnim is literally a function inside Animate, which is a core script as far as I am aware.

Its a module script in playerscripts

This is the client that handles all the binds when fired

-- Services --
local Players = game:GetService('Players')
local InputService = game:GetService('UserInputService')
local Replicated = game:GetService('ReplicatedStorage')
--

-- Variables --
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
--
local Character = Player.Character
local Events = Replicated:FindFirstChild('Events')
--

-- Main --
InputService.InputBegan:Connect(function(Input,GPE)
	if GPE then return end
	--
	local Binds = Input.UserInputType
	local Bindz = Input.KeyCode
	if Binds == Enum.UserInputType.MouseButton1 then
		Events.NoTool.Catch.Event:FireServer('Catch')
	elseif Bindz == Enum.KeyCode.E then
		local Controls = require(Player.PlayerScripts:WaitForChild('Controls'))
		Controls.Actions('Dive',Input.UserInputState)
	elseif Bindz == Enum.KeyCode.X then
		local Controls = require(Player.PlayerScripts:WaitForChild('Controls'))
		Controls.Actions('Block',Input.UserInputState)
	end
end)
--

Still, before being in PlayerScripts it’s stored in a roblox core folder. So it’s really weird unless you called it wrong.

Can i see the line where you use the function? The one where the error happens. It could have something to do with that? Maybe its called incorrectly?

function TA.Block()
	local Player = Players.LocalPlayer
	--
	if not PAnims.Block then
		PAnims.Block = Player.PlayerScripts.Animate:LoadAnim(Anims.Block)
	end
	--
	if Player.Character:FindFirstChild('Values').CanBlock.Value then
		Anims.Block:Play()
		return
	end
	Anims.Block:Stop()
end

Im not sure thats how you use a function in a module script? You also need to do the require thingy for module scripts for them to work iirc… You judt use a dot instead of a colon but i could be wrong (srry for misspell im on mobile) is the quoted text supposed to define the module script?

I don’t think loadanim can be in Modules

try finding or creating it and then put it. Or you can just manually do it. And also, this may occur depends on if its client or server script

let’s say you put an important folder on server storage, the server can access it, but the client can’t.

And maybe you can ONLY put loadamin on humanoids. I just dont know any of the problem.

if the above text helped you, to fix the problem maybe you use remotes to send messages to each other. If you already have it, then just ADD MORE.