generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Can Private Modules be used in tools?

Previous Thread :: Next Thread 
Draekin is not online. Draekin
Joined: 25 Jan 2012
Total Posts: 208
29 Mar 2016 09:57 PM
I have a tool and it requires() fine in Studio. But when I try it in-game I get an error saying 'require(assetId) cannot be used in client'.
Report Abuse
Encladeus is online. Encladeus
Joined: 27 Dec 2010
Total Posts: 3839
29 Mar 2016 09:59 PM
lol
Report Abuse
ThoughtConduit is not online. ThoughtConduit
Joined: 30 Nov 2015
Total Posts: 536
29 Mar 2016 10:02 PM
I'm guessing no because tool scripts might need to do LocalPlayer:GetMouse() which can only be done in LocalScripts, and require(assetid) can only be done in ServerScripts. Maybe parts of it can be in a PrivateModule and use RemoteFunctions


Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
29 Mar 2016 10:02 PM
If it says it can't be used in the client then it can't be used in the client. *sigh*



Report Abuse
1080pHD is not online. 1080pHD
Joined: 10 May 2012
Total Posts: 1192
29 Mar 2016 10:15 PM
That is because you are not allowed to require a module from its asset id in a localscript.
You'll need to place the module in the game and require from there.
Report Abuse
Draekin is not online. Draekin
Joined: 25 Jan 2012
Total Posts: 208
29 Mar 2016 10:17 PM
If that's the case would it be possible to use a server script to require and then link or refer that to the localscript which would have needed to require the private module in the first place?
Report Abuse
adam1717 is not online. adam1717
Joined: 07 May 2011
Total Posts: 960
29 Mar 2016 10:22 PM
Store a local script inside the Module then clone it
Report Abuse
1080pHD is not online. 1080pHD
Joined: 10 May 2012
Total Posts: 1192
29 Mar 2016 10:23 PM
I hope I understand correctly, do you mean requiring a module and putting it somewhere in the game so that the localscript can require the parented module?
Report Abuse
1080pHD is not online. 1080pHD
Joined: 10 May 2012
Total Posts: 1192
29 Mar 2016 10:25 PM
Whoops.

well I meaning requiring a module that returns another module.
Report Abuse
1080pHD is not online. 1080pHD
Joined: 10 May 2012
Total Posts: 1192
29 Mar 2016 10:25 PM
mean*

:/ help.
Report Abuse
Draekin is not online. Draekin
Joined: 25 Jan 2012
Total Posts: 208
29 Mar 2016 10:31 PM
Well yeah, now my setup is like this: There's a ModuleScript Within workspace that requires(assetId) and returns that. Now My tool would require the module script within Workspace. Do you think that would work? The module script that requires the asset isn't in any local environment anymore.
Report Abuse
1080pHD is not online. 1080pHD
Joined: 10 May 2012
Total Posts: 1192
29 Mar 2016 10:38 PM
Yes, that will work.

I've even tested something like this before myself.
Report Abuse
Draekin is not online. Draekin
Joined: 25 Jan 2012
Total Posts: 208
29 Mar 2016 10:42 PM
Hey uh, I tried it and it still returns the same error. Why? The one that fetches the assetId isn't in the tool anymore
Report Abuse
1080pHD is not online. 1080pHD
Joined: 10 May 2012
Total Posts: 1192
30 Mar 2016 07:57 AM
Put this in the localscript: require(workspace.FirstModule.SecondModule)

Are you sure the module you're having errors requiring is in workspace?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
30 Mar 2016 09:05 AM
This thread annoys me.

You can't require a module by ID in a LocalScript.


"Well yeah, now my setup is like this: There's a ModuleScript Within workspace that requires(bobetId) and returns that."
You can't do that because ModuleScripts behave as LocalScripts when required from a LocalScript.


"If that's the case would it be possible to use a server script to require and then link or refer that to the localscript which would have needed to require the private module in the first place?"
In 4 out of 5 cases that won't work. You can't send things like functions, userdata, and so forth.


"Store a local script inside the Module then clone it"
That would defeat the purpose of the private module concept.


You can't use private modules on the client, no matter what.
The only real purpose for private modules is to allow other people to use them on the server without them being able to steal them unless they are 31337 h4x0rz or at least know what they're doing.


Report Abuse
ThoughtConduit is not online. ThoughtConduit
Joined: 30 Nov 2015
Total Posts: 536
30 Mar 2016 09:24 AM
@jarod
what about remotefunctions like I told them to do and they ignored


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image