"Attempt to call nil value" despite all values NOT being nil

I am remaking my damage scripts and one error has tormented me for the past 30 minutes:

print(hit.Parent)
print(script.Parent.Character.Value)
module.InflictDamage(script.Parent.Character.Value,
hit.Parent,
30,false,
script.Parent.Name)

There is an error at the 67th line (3rd here) claiming the value is nil but both of the prints above clearly show they are not.

Dummy  -  Server - Script:65
  10:12:10.961  Oinky435  -  Server - Script:66
  10:12:10.961  Workspace.Oinky435.LaserPistol.Script:67: attempt to call a nil value  -  

Is there something I am not catching?

That means the function doesnt exist try printing module.InflictDamage

it does print nil, but I do have an InflictDamage module function (i verified, no typos)
why is it not detecting?
It worked before, and now it doesn’t for some reason
(there are no errors on the side of the ModuleScript)

Make sure you’re requiring the right module, make sure the function is actually attached to the module. Unfortunately I cant help more because I need to sleep as it’s 4:30 AM.

1 Like

ok good night I guess
(not exactly sure what to do with this but thanks)

Can we see the line where you require the module as well as the module script code?

The module:

function module.InflictDamage(attacker,touchedCharacter,amount,crit,weaponname)

The tool’s Require:

local module=require(game.ServerScriptService.ModuleScript)

there’s no typo i don’t understand why must lua make me suffer like this :cry:

this is odd you dont have 2 values called module or 2 ModuleScripts in serverscript service called ModuleScript do you?

no, that’s the worst part!
i checked and double checked, i have one module value and one module script in serverscriptstorage.

my old module script seems to make it work, i’ll use this backup and start my recoding from scratch

just want to verify in the new one you didnt delete the return module by accident did you?

no, i didn’t.

blah blah blah character limit gotta artificially extend message

oh
wait
i think i found the problem
i misplaced an “end”
:I
guess i really am an idiot after all lol