Module / Function Issues

Module Issues

Hello! I am Domderp999. I make live events in the Roblox Community. I am currently struggling with Modules and Functions.

My Goal is to move Functions that are normally in one script, to a module script so I can use them in multiple scripts. This is useful in many situations. I’m sure many of you have had to use Module Scripts before.

My issue, is that when I move the function to a Module script, it doesn’t work fully. I don’t get errors or anything so I am heading to the Developer Forums to get some feedback. The Function works in normal scripts, but when I moved it into a module script it worked differently and not like it was supposed to. The Code in the Module :


Am I doing anything wrong in here?

Can you also show the script that requires the module? The problem might be there

Also, local TS = game:GetService( "TweenService") you do this twice, you should delete the second time.

Seems like you’re missing a parameter while running the function, you only give it five parameters while calling it but in the module it has 6 parameters

Oh I tested it. It works, just not all the way. Its not where the module script is being called.

So you’re saying it’s still not working properly after you pass the proper amount of parameters?

Just judging by your parameter names it seems like you forgot to give the Amount parameter

I fixed it. It still doesn’t work. Everything is perfectly correct. It does do something, but it doesnt do it fully.

Can you give more details? What do you want it do and what isn’t it doing that it should do?

Well, what I want it to do is extremely complicated to explain. But im just going to say it doesnt do it correctly. I got a message that I wasnt returning the variables. Which I am clueless on what that means.

Can you send that message?

image

Absolutely no idea what he means by that

LinePart.Material = "Neon" This probably isn’t the problem but I think you’re meant to do LinePart.Material = Enum.Material.Neon

Is there anymore code that might have to do with the issue that you haven’t shown?