Help on Mannequin

Hello! I’m building a homestore and I need help on scripting mannequins.
I’m not the best scripter, so I looked on the devforum for some posts about mannequins to help me out and I came with the following: robloxapp-20211208-1752004.wmv (2.6 MB)
I thought this mannequin was kind of good, but I decided to go and look in some other clothing stores to see how they made the mannequins and I saw the following:


In my opinion, this was the best mannequin to exist, because you can see the avatar, you can see the items, you can try the avatar on and you can buy the items.
My question is: How can I make something like this too? Or is there a model someone made because I have seen this type of mannequin in multiple games. I hope you can answer my questions. :slightly_smiling_face:

~ Boaz, aka Baas_bb

1 Like

They’re using ViewportFrame instances to render the 3D accessories/items/objects in a Gui.

I would assume they’re likely using a free model as you suggested if you’ve seen this exact Gui style in multiple games.

This might be the resource you’re looking for.

As with many mannequins, you’re able to save or download content into the HumanoidDescription, which is an instance that every Humanoid has (in a character model).

First of all, you’d want to load the mannequin with a player’s outfit - in this way, I’ll be using their userId through the function Players:GetHumanoidDescriptionFromUserId():

-- Script in ServerScriptService

local players = game:GetService("Players")
local replicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = replicatedStorage.RemoteEvent -- make sure to create a RemoteEvent in ReplicatedStorage.
-- this is to communicate with the client to open a UI for them.

local mannequins = -- group all mannequins so they're in the same model
...

image

local mannequins = workspace.Mannequins:GetChildren()
...

local userIds = { -- insert the players' userId that you want to display.
    1234, 1234, 1234
}
...

Then, iterate through every userId in the userIds table and load a mannequin via HumanoidDescription (see above):

...
-- spawning mannequins //
local iterated = 0 -- to move to another mannequin.

for _, userId in pairs(userIds) do

	-- if there's more userIds than mannequins then a warning occurs //
	if iterated == #mannequins then
		warn("There's no reserved mannequins for other userIds.")
		break
	end

	iterated += 1

	-- applying the userId's outfit //
	local mannequin = mannequins[iterated]
	
	local humDesc = players:GetHumanoidDescriptionFromUserId(userId)
	mannequin.Humanoid:ApplyDescription(humDesc)

	-- creating prompts for their torso //
	local prompt = Instance.new("ProximityPrompt")
	
	prompt.ObjectText = "Outfit"
	prompt.ActionText = "Try / Buy"
	
	prompt.Parent = mannequin.PromptPart
	
	-- when prompt has been triggered //
	prompt.Triggered:Connect(function(player)
		
		remoteEvent:FireClient(player, humDesc)
		
	end)

	-- pops up if iterated through all //
	if iterated == #userIds then
		print("Iterated through all userIds successfully.")
	end
end

Secondly, you’d want to add a UI and script it. I just made this so you can access it by the place file I uploaded beneath. Should prevent clutter - I commented on it to explain things. If you have any questions, DM me.

Baseplate.rbxl (48.6 KB)

2 Likes

Thank you very much! This really helped me out!