Module Error Makes no sense

I’m tryin to get my code to run with my module but its giving me a error that is making no sense to me. What is happening?

Client:

-- 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')
	end
end)
--

Module:

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 = {
}
--

-- Functions --
function 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 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 V6 = not Humanoid.Jumping and Powers.Normal or Powers.InAir
	P2 = P2 or Humanoid.MoveDirection * Humanoid.WalkSpeed
	--
	RootPart.AssemblyLinearVelocity = Vector3.new(V6.Linear * P2.X,V6.Vertical,V6.Linear * P2.Z)
	RootPart.AssemblyAngularVelocity = Vector3.new(P2.Z,0,-P2.X) * V6.Rotation
	Humanoid.PlatformStand = true
end
--
function Actions(P5,P6)
	if P6 == Enum.UserInputState.Begin then
		if P5 == 'Dive' then
			if not U2 then
				Dive()
			end
		end
	end
end
--

-- Main --
function TA.Start(P7)
end
--
1 Like

what is the error? (3.0charss)

1 Like

you are not retturning TA at the end, add this at the end of the module:

return TA
1 Like

It gave me a new error.

change this to:

TA.Actions = function(P5,P6)

Nothing prints in the output when I press e but I still cant dive

you are not sending P6 aka UserInputState

Would I set it to “Input” or “Bindz”

Input.UserInputState (3.0chars)

What are you referring ‘3.0chars’ too?

i cant send replies with less than 3.0 cha.rac.ters, so i add (3.0chars) to add more characters to the reply

2 Likes

Controls.Dive hasn’t been declared global in the modulescript.
Change this

to this

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 V6 = not Humanoid.Jumping and Powers.Normal or Powers.InAir
	P2 = P2 or Humanoid.MoveDirection * Humanoid.WalkSpeed
	--
	RootPart.AssemblyLinearVelocity = Vector3.new(V6.Linear * P2.X,V6.Vertical,V6.Linear * P2.Z)
	RootPart.AssemblyAngularVelocity = Vector3.new(P2.Z,0,-P2.X) * V6.Rotation
	Humanoid.PlatformStand = true
end
1 Like

it wont do anything, he is using the function Actions to activate the local functions

2 Likes

So theres nothing I can do? (“3.0 chars”)

1 Like

you removed the return TA from the end of the module

1 Like

Oh. I didn’t even realize my bad :sob:

1 Like

Yoooo. It works now :shock: (3.0 chars)