Why is my module not working?

I have 3 different scripts connected (Local, Server and Module) I’m not to sure if I’m sending the wrong values or anything but why isn’t the module script playing at all.

This is the Local Script

-- Services
local RS = game:GetService("ReplicatedStorage")

-- Folders
local RSStorage = RS.Storage
local RSEvents = RSStorage.RemoteEvents

-- Character/Humanoid
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local HRP = char:WaitForChild("HumanoidRootPart")

-- Values
local RollHeight = 100
local FallDamageHeight = 175

hum.StateChanged:Connect(function(_, NewState)
	if NewState == Enum.HumanoidStateType.Landed then
		local Height = -HRP.Velocity.Y
		print("Landed with Height: " .. Height)
		
		-- Landing
		local LandAnim = script:FindFirstChild("Land")
		if LandAnim and Height >= 65 and Height <= RollHeight then
			local playAnim = hum:LoadAnimation(LandAnim)
			playAnim:Play()
			task.wait(1)
			playAnim:Stop()
		end
		
		
		if Height >= RollHeight and Height <= FallDamageHeight then
			RSEvents.MovementEvents.Roll:FireServer(Player,char,Height)
			
			-- Roll Height
		elseif Height >= FallDamageHeight then 
			RSEvents.MovementEvents.FallDamage:FireServer(Player,char,hum)
			-- Fall Damage Height	
		end
		
	end
end)

This is the server script

RollEvent.OnServerEvent:Connect(function(plr, char, hum)
	print ("Roll Event (Server)")
	
	RollModule.Roll(plr,char,hum)
end)

and This is the Module script

local module = {}

function module.Roll (plr,char,Hum)
	-- Services
	local RS = game:GetService("ReplicatedStorage")
	
	-- Folders
	local RSStorage = RS.Storage
	local RSAnimations = RSStorage.Animations
	
	-- Values
	local HumRP = char:WaitForChild("HumanoidRootPart")
	local RollAnimation = RSAnimations.Movement.Roll
	
	local RollDebounce = false
	local DashingDebounce = false
	local CanDoAnything = true
	
	-- Modules
	local SoundModule = require(RSStorage.Modules.Combat.SoundsModule)
	
	
	if RollDebounce == false and char:FindFirstChild("Disabled") == nil then
		RollDebounce = true
		CanDoAnything = false
		delay(0.3,function()
			CanDoAnything = true
		end)
		delay(2.5,function()
			RollDebounce = false
		end)
		Hum.JumpHeight = 0
		RollAnimation:Play()
		DashingDebounce = true
		-- Play with sounds module
		SoundModule.PlaySound(plr,"Roll")
		delay(0.25,function()
			DashingDebounce = false
			Hum.JumpHeight = 7.2
		end)
		repeat
			HumRP.Velocity = HumRP.CFrame.lookVector * 130 / 1.5
			wait(0.1)
		until DashingDebounce == false
		
	end
	
	if RollDebounce == true  then
		Hum.JumpHeight = 0 
		wait (0.5)
		Hum.JumpHeight = 7.2
	end
	
end




return module

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.