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

One UI for all my places?

Asked by
Tor6 0
8 years ago
Edited 8 years ago

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.

0
That way I only have to update the UI in one place and its good to go Tor6 0 — 8y
0
Anyone know? Wiki doesn't rally have anything about this. Tor6 0 — 8y
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. M39a9am3R 3210 — 8y
0
okay thank u! Tor6 0 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

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

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? Tor6 0 — 8y
0
Yes, that's what I meant. TheDeadlyPanther 2460 — 8y
0
Alright thanks! Tor6 0 — 8y
Ad

Answer this question