Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make an Auto Clothes script?

I need to make a script so when you join a place it automatically changes your shirts and pants to the uniform, depending on your rank. Help?

1 answer

This bit of code will change the pants and shirt of players if their rank is above a certain rank.

local GroupID = # -- Change this to the ID of the group
local GroupRank = # Change this to the group rank you wish
local Pants = http://www.roblox.com/asset/?id=# -- Change # to the ID of the Pants Template
local Shirt =http://www.roblox.com/asset/?id=# -- Change # to the ID of the Shirt Template

game.Players.PlayerAdded:connect(function(Player)
	Player.CharacterAdded:connect(function(Character)
		if Player:GetRankInGroup(GroupID) >= GroupRank then
			Character.Pants.PantsTemplate = Pants
			Character.Shirt.ShirtTemplate = Shirt
		end
	end)
end)

3 comments

0

Can I make it so it's equal to the rank? Would I just put "if Player:GetRankInGroup(GroupID) == GroupRank then" as line 08?

0

Yeah, that would work just as well

0

Will I have to make a seperate script for each group rank? For example, if group rank 1 and 2 had the same uniform and group rank 3 had a different one, would I just make a script for 1 and 3?

This discussion is preserved as it was. New answers, comments, and votes are closed.