Module acts like number is something else yet theirs no console output

I am VERY confused, this might be an issue with my code that I can’t see myself however when this number is passed into the module theirs a logic error however its like the number doesn’t even exist yet if it didn’t exist it would say “nil” instead it just doesn’t even show the warn on console.

Local Script in StarterPlayerScripts

image

The Module (Child of local script)

image

Console output (Only 1 / 3 warns appeared)

image

This is a simplified version of the actual module however it should still at least print the number. am I doing something wrong here?

Well, in the module it looks like the function CreateCutscene is being defined with a dot . rather than a colon : which the local script uses. When you call a function with a : when there’s suppose to be a ., it would pass the module (self) as the parameter instead of what you sent.

To fix this, just define it like this:

function CameraService:CreateCutscene(cutsceneTime)

or call the function like how it was defined:

local Tween = CameraService.CreateCutscene(10)

I am blind lol, thank you for showing me the issue!

1 Like