|
| 10 Mar 2017 04:42 PM |
| Can I put same code as scripts there or |
|
|
| Report Abuse |
|
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 10 Mar 2017 04:44 PM |
| http://wiki.roblox.com/index.php?title=Intro_to_English |
|
|
| Report Abuse |
|
|
Oryxide
|
  |
| Joined: 09 Jul 2015 |
| Total Posts: 647 |
|
|
| 10 Mar 2017 04:44 PM |
| https://youtu.be/T5V-IYCjK10?list=PLatbVFCcsDB8jgIzJ3a4_q6CeGnsD0rhf |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:45 PM |
ModuleScripts won't run if the server is starting.
You can access them by Scripts or Localscripts to use functions out of them |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:47 PM |
| Module scripts return a table of stuff to normal scripts, so no. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:49 PM |
| Technically, you could. But why would you? |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:49 PM |
| I knew the answer, just needed a checkup thanks |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:49 PM |
| @Intended You can use a ModuleScript just as # ############# it would just have to be required in # ############# Therefore it's useless. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:50 PM |
| ^ Roblox censorship at its finest |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:51 PM |
| You still have to leave the module return stuff in it so no. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:51 PM |
| I don't see why they block "Server Script", honestly. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:52 PM |
| Welcome to the wondrous world of whitelists. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:55 PM |
@Intended You can, it's just useless. As an example.
--Module Script
local module = {} local Sound = Instance.new('Sound', game.Workspace) Sound.SoundId = ('rbxassetid://636383865') Sound:Play() return module
--Server Script
loadstring(require(modulelocation))() |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:55 PM |
Edit:
It does error, but either way. It still works. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:56 PM |
| You just proved what I wrote: You have to return something in a module script. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:57 PM |
^ Shouldn't be possible lol Wiki: Unlike other scripts, a module does not execute when a game starts |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:57 PM |
| Yes, but in reply to OP. It works, you just have to return something. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:57 PM |
| ^ Was for @OnceAlwaysFamous |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:59 PM |
| @maxi That is exactly why you have to require the module using loadstring in # ############# |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 04:59 PM |
| The hashtags were "a Server Script" lol |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 05:00 PM |
you require a module like that:
local module = require(ID or the object in your game like game.ReplicatedStorage.Module) |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 05:02 PM |
@maxi
Correct, but if you aren't calling a function or anything, that is useless. Otherwise just use it like this (even though it errors, it works). loadstring(require(game.ServerScriptService.ModuleScript))() |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 10 Mar 2017 05:07 PM |
@Once
Something tells me you don't know what loadstring does.
Just stop. |
|
|
| Report Abuse |
|
|
hasang1
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 903 |
|
|
| 10 Mar 2017 05:09 PM |
@Once You would only need to use loadstring if the ModuleScript returned a string. If it returns a function, require(ID)()
HAX. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 05:12 PM |
@chim
Keep thinking that <3 |
|
|
| Report Abuse |
|
|