IdentityService
IdentityService is a Module created to recreate all functions from Roblox’s HumanoidDescription system and add many more and useful functions.
There are currently only 3 functions, but I’m planning to continue to add more features and update this more.
Pros:
- Uses HumanoidDescription instances to work seamlessly with Roblox’s current system
- Heavily commented for those who want to look over or contribute to the module
- Easy to learn and use, functioning similarly to Roblox’s HumanoidDescription functions
- Completely open source, meaning you could easily modify it to add your own functions along with the existing ones.
Cons:
- The module is still in development, so not all functions are available yet.
- Not made for R15 / Rthro yet (May add support in the future)
Useful Features
- You can get any NPCs humanoid description with a function instead of having to set it all manually or get it from a player
- Not much else at the moment, but this system will contain many more things in the future
Demonstration
Documentation
Functions
CreateHumanoidDescription
Generates a HumanoidDescription based on the humanoid’s current appearance and returns it.
Parameters:
Humanoid
Returns:
HumanoidDescription
local humanoidDescription = IdentityService.CreateHumanoidDescription(YOUR_HUMANOID)
GetHumanoidDescription
Retrieves the HumanoidDescription of a character or creates a new one if none exists.
Parameters:
Humanoid
Returns:
HumanoidDescription
local humanoidDescription = IdentityService.GetHumanoidDescription(YOUR_HUMANOID)
ApplyHumanoidDescription
Applies the stored HumanoidDescription to a character to update their appearance.
Parameters:
Humanoid, HumanoidDescription
IdentityService.ApplyHumanoidDescription(YOUR_HUMANOID, HumanoidDescription)
Example Code
local replicatedStorage = game:GetService("ReplicatedStorage")
local identityService = require(replicatedStorage:WaitForChild("IdentityService")) -- Requires IdentityService
local model = script.Parent.Parent -- Gets Morph Model
local button = model:WaitForChild("Button")
task.wait(0.5) -- Wait for NPC to load
local npc = model:FindFirstChildOfClass("Model")
local npcHumanoid = npc:WaitForChild("Humanoid")
local humanoidDescription = identityService.CreateHumanoidDescription(npcHumanoid) -- Create a Description for the Morph
button.Touched:Connect(function(object)
local humanoid = object.Parent:FindFirstChildOfClass("Humanoid") -- Find the character's Humanoid
if humanoid and humanoidDescription then
identityService.ApplyHumanoidDescription(humanoid, humanoidDescription) -- Apply the Morph's description to the humanoid
end
end)
Contributions and feedback are welcome! Feel free to suggest improvements or report issues.
→ Download ←
Morph Demonstration.rbxm (9.0 KB)
- Yes
- No
0 voters