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?
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:
This is how it looks in game:
(Green dot is an attachment, made it visible to make it clear)
You can also weld parts with Handle:
This is how it looks in game:
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
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:
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
How do you weld the parts to the handle?
This is what my directory looks like right now. What is the next step?
Image:
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
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)