Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Return a variable using Modules?

So i'm currently using a Module as a base for sending & receiving important functions within my game, and as one of the special functions i want to be able to return the current player so i won't have to waste 3-4 lines to try and get it another way.

I'm looking on the wiki and the Module Scripts tutorial isn't helping much.. anyone know a solution to transferring a value back from the script that executed the function from the module in the first place?

Thanks in advance!

2 comments

0

Your question isn't very clear. Post your scripts.

0

There isn't one.. i'm asking if its possible to return the LocalPlayer through a ModuleScript.

1 answer

If you're requiring the Module from a LocalScript, just use Game.Players.LocalPlayer, otherwise you're going to have to be more specific in why you need the ModuleScript to return the 'current' player.

This discussion is preserved as it was. New answers, comments, and votes are closed.