MorphModule - Easy way of managing your morphs

banner

Introduction

Heya, I’m le_fishe or known as Realy and today I decided to make this very creatively named module!

This module is targeted at those who’s game work around using accessories to manage their game’s morph/armor needs or anything similar, due to this their study may get messy or their code where they could use 1 module to limit amount of their repetitive code use on the serverside at least.

This is the basic and first documented module I’ve released so I may add or improve it over time just so those who use it can clear up any mess they may have or make their lives easier.

Set up

  1. Insert this module or copy and paste code from github into a module and name it MorphModule and place it into ServerScriptService
  2. Make a folder and name it Morphs and place it into ServerStorage
  3. Create any sub folders that may be used for teams, players, etc and make sure there’s no repeating names
  4. Require the module from another server script and run .new(The morphs folder instance) to give the module the location and the instance of the folder where you’ll be storing all your morphs
  5. Read the module documentations and enjoy!

Note: This is designed for accessories and not models, if you don’t know how to convert morphs to accessories there are many tutorials on how to do that from where you can use this.

Pictures

image
image

https://gyazo.com/bf336767bb6712ef15e9108b00aa37b5

Documentation

.new(Morph folder name) -- Will set this as the default folder that all morphs are stored in, only needs to be ran once on a server script for the whole game
	
:ApplyFullMorph(Player instance, Folder name, Clothes: true/false, Faces: true/false) -- This applies whole morph to the directed user in the first argument 
:ApplyMorph(Player, Folder name) -- This only applies the morph but can be considered a faster way of applying as it doesn't check if you want clothes with it or not
:RemoveWholeMorph(Player, Morph name aka the folder name) -- Removes the whole of the morph including the clothes with it without touching anything else that doesn't exist in the original folder
:RemoveMorph(Player, Morph name aka the folder name) -- Removes only the morph without the clothes without touching any other accessories that aren't named the same at least
	
Keep in mind that you need to create a folder inside ServerStorage named `Morphs` and from there you can split morphs into team folders or individual folders 
than the script will find itself unless there are duplicate instances of those
	
*Make sure that all of the morphs are unanchored or your character will get stuck in place!!*
You can as well insert any shirts or pants inside the folder you want to be applied and they can be named anything you want.

Planned updates

  • Add feature which saves your original character and It’s accessories which you can morph back to including one with a clothes function.

Conclusion

You can contact me on the forum if you have any questions,
Feedback of any sort is always appreciated, positive, negative!

You can get the model or the code from my github or from the published model!

Thanks for reading :smiley:

13 Likes

I’ve been looking for something like this for a long time, thank you!

1 Like

:+1:

I love accessories when it comes to adding pieces of clothing or other wearables onto the character. They’re really easy to use and even easy to add new attach points around the character since all the logic to handle welding is baked into the Humanoid. Nice module and good catch on a great way to apply assets to characters (your use case, military armour, is a good fit as well).

One thing I would recommend is that if this module is written OOP-style then you also include a Destroy method. Developers should be able to call this method or indirectly (e.g. via Maid) to clean up the object’s assets as well as the object itself. Classes should always try to include a cleaning function to get rid of any items that are no longer being used.

3 Likes

Yeah I was planning to add a maid function to this but I didn’t have the time and scheduled it for V1.5 release

1.5? How far off is that? I’m not sure where to view the current version of the module since there’s no specification in the thread or in releases. If you’re going semver, might be a bit more accurate to make that number lower… but that’s just me nitpicking.

How available would you be to accepting PRs by chance and would they conflict with your updating of the module or are you able to work any PRs into your updates? I figure that since it’s in a repo I might as well submit them in if I can get them done fast ahead of a minor increment.

Yeah I’m fine with them as long as I see them improve the state of the code

This seems pretty nice, definetly better than some of my old Morph scripts

Just for the sake of performance I would suggest using HumanoidDescription although it really isn’t neccessary.

Also if you could provide pre written examples already in the model for people who don’t know how to use modules.

And if you’re going to do any small code change you will have to reinstall for every update so I would suggest using UserId for the module. such as require(ModuleId)

If you want to see how I did it you can see the module of the model

Anyway nice work!

Thanks, will do that as well bit later

Update:

  • Added functionality to custom faces, you can now insert a decal into your morph folder and it will apply through usage of ApplyWholeMorph the last bool parameter will decide if you want the faces to be applied or not.
  • New leg functionality, when using R15 your accessories might be stuck in place and your legs moving. Not anymore at least, to use it correctly name anything that is corresponding to LegHip as Left Upper Leg or Right Upper Leg for it to work correctly.
  • Renamed few of the instruction methods to correct names just so people aren’t confused why some of this doesn’t actually work.