Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make an Auto Clothes script?

Asked by 10 years ago

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

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

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)
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? Animotion 0 — 10y
0
Yeah, that would work just as well BlackJPI 2658 — 10y
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? ElxtriicBlxssom 0 — 4y
Ad

Answer this question