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

One UI for all my places?

Okay so I am working on a game that includes one place I use as a menu and multiple other places that can be teleported to through my main place (the menu). All these various places people can teleport too all have the exact same UI, but since there is so many places each time I update one place's UI I have to update all the other places as well (manually) and it becomes a pain. Is there a way through which I can have one place set aside that contains all my UI and that that UI is transfered to the place the person teleports too when he or she does so. Is this possible through perhaps datastore or something? It would make things way more easier.

4 comments

0

That way I only have to update the UI in one place and its good to go

0

Anyone know? Wiki doesn't rally have anything about this.

0

Use a ModuleScript. Script the GUIs in the module script, have the script identify all the information it needs such as where the player is going or etc. Then just have scripts require that one module script and it should change universally.

0

okay thank u!

1 answer

✓ Accepted answer

NOTE: This is basically an explanation and example of what M39a9am3R said.


ModuleScripts are a pretty useful tool, especially when it comes to one script controlling things in multiple places. They can be uploaded to ROBLOX, then required using their ID. Here is a quick guide on using it:

1: CREATION

Create your ModuleScript.

Name it 'MainModule', and parent it in ServerStorage, or it won't work.

Then, get it's ID (it can be found in the url, for example: http://www.roblox.com/item.aspx?id=12345678).

2: IMPLEMENTATION

Now, you simply have to require() it in a script, using it's ID, for example:

local module = require(12345678)

Now, the rest is easy. Uploaded ModuleScripts can store GUIs, and other scripts, so you won't have a problem with that.


Hope I helped! If you need anything, please just ask.

~TDP

3 comments

0

Alright thanks! One question tho do I have to publish this modulescript as a model in order to get it's ID? I don't see the ID under properties or anything?

0

Yes, that's what I meant.

0

Alright thanks!

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