Help with auto uniforms

I am looking for help in order to first turn a model into an accessory such as a vest. Then I would like to learn how to script the uniforms to be given to people who have specific group ranks. Is this achievable and if so, how would I complete this task?

2 Likes

For that u need to create an accessory and insert in it a part with the name “Handle”. This part must have an attachment by what vest will connect with a player:
image

This is how it looks in game:
image

image

image
(Green dot is an attachment, made it visible to make it clear)

You can also weld parts with Handle:
image

This is how it looks in game:
image

To give a vest to the player with a specific rank, you need check if this player is in the group (Player:IsInGroup(GroupId)) and then check player’s rank (Player:GetRankInGroup(GroupId))

Script:

local Players = game:GetService("Players")
local GroupId = 10001027

Players.PlayerAdded:Connect(function(Player)
	if Player:IsInGroup(GroupId) then
		if Player:GetRankInGroup(GroupId) == 100 then
			-- Giving the vest
		elseif Player:GetRankInGroup(GroupId) == 255 then
			-- Giving the vest
		end
	end
end)

I hope it helped you :grinning:

1 Like

The vest that I have is multiple parts. How would I add multiple parts to it? Also, would I put the script in ServerScriptService and where would I put the vest once it is finished?

If you are looking to gives players custom outfits on spawn you can use the HumanoidDescription system. More resources can be found here:

1 Like

You can just weld all this parts with the Handle. Yes, put it in ServerScriptService and you can make a folder for all your vest and clone them from it

1 Like

This is the full uniform that I want to give to the user who has a specific rank.

Image:

How do you weld the parts to the handle?

I use Moon Animator for that, it has a thing called “Easy Weld”

This is what my directory looks like right now. What is the next step?

Image:
Hawkins National Laboratory - Roblox Studio 2021-04-17 12_33_40 PM

Weld all of the parts together either with “Welds” or with “WeldConstraints”. As @Ti4rin mentioned, you can use things like MoonAnimator with EasyWeld to use normal Welds.

Do I just select all of them and then weld?

U need to ungroup all your parts, click on Handle, select other parts, open Easy Weld → Parts, make Animatable off and press Join In Place

Like this?

Image:

Yes, now you need to make a script that inserts it in player’s character

Wait, so that is the correct way to make that welded?

Also, I was also asking how to make the script.

I gave you an example of it in my first post

The example that you gave me is just for the ranks script, how would I actually put it into the character?

Something like that:

local Players = game:GetService("Players")
local GroupId = 10001027

Players.PlayerAdded:Connect(function(Player)
	if Player:IsInGroup(GroupId) then
		if Player:GetRankInGroup(GroupId) == 100 then
			local Character = Player.Character or Player.CharacterAdded:Wait()
			local Vest = game.ServerStorage.Vests["Vest-100"]:Clone()
			
			Vest.Parent = Character
		elseif Player:GetRankInGroup(GroupId) == 255 then
			local Character = Player.Character or Player.CharacterAdded:Wait()
			local Vest = game.ServerStorage.Vests["Vest-255"]:Clone()

			Vest.Parent = Character
		end
	end
end)

1 Like

Did I do something wrong because it appears to not be working?

Image: