Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Return a variable using Modules?

Asked by 9 years ago

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!

0
Your question isn't very clear. Post your scripts. 2eggnog 981 — 9y
0
There isn't one.. i'm asking if its possible to return the LocalPlayer through a ModuleScript. RobloxHelper49 55 — 9y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

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.

Ad

Answer this question