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

Is their a way to make this uniform script for each rank?

Asked by
Zequew 0 Donator
8 years ago

What I mean is that when I say " NEUniform " in my game, I want it to put me into the uniform. But I don't know how to add the HC rank into the script and to add the pants into the script for each rank Is it possible that their is a way for it to work?

LRShirtTemplate = "rbxassetid://419314997"
MRShirtTemplate = "rbxassetid://253415877"
HRShirtTemplate = "rbxassetid://253416200"
PantsTemplate = "rbxassetid://253482723"

local function onChatted(msg, recipient, speaker)
    if msg:lower() == "neuniform" and speaker.TeamColor == BrickColor.new("Medium blue") then
        if speaker.Character.Torso:findFirstChild("roblox") then
            speaker.Character.Torso.roblox:Destroy()
        end
        if speaker.Character:findFirstChild("Shirt Graphic") then
            speaker.Character["Shirt Graphic"]:Destroy()
        end
        if speaker.Character:findFirstChild("Shirt") then
            speaker.Character.Shirt:Destroy()
        end
        if speaker.Character:findFirstChild("Pants") then
            speaker.Character.Pants:Destroy()
        end
        if speaker:GetRankInGroup(2583611) >= 1 and speaker:GetRankInGroup(2583611) <= 5 then
            local LRShirt = Instance.new("Shirt",speaker.Character)
            LRShirt.Name = "LRShirt"
            LRShirt.ShirtTemplate = LRShirtTemplate
            local Pants = Instance.new("Pants",speaker.Character)
            Pants.Name = "Pants"
            Pants.PantsTemplate = PantsTemplate
        elseif speaker:GetRankInGroup(2583611) >= 6 and speaker:GetRankInGroup(2583611) <= 9 then
            local MRShirt = Instance.new("Shirt", speaker.Character)
            MRShirt.Name = "MRShirt"
            MRShirt.ShirtTemplate = MRShirtTemplate
            local Pants = Instance.new("Pants", speaker.Character)
            Pants.Name = "Pants"
            Pants.PantsTemplate = PantsTemplate
        elseif speaker:GetRankInGroup(2583611) >= 14 then
            local HRShirt = Instance.new("Shirt", speaker.Character)
            HRShirt.Name = "HRShirt"
            HRShirt.ShirtTemplate = HRShirtTemplate
            local Pants = Instance.new("Pants", speaker.Character)
            Pants.Name = "Pants"
            Pants.PantsTemplate = PantsTemplate
        end
    end
end

game.Players.PlayerAdded:connect(function(newPlayer)
    newPlayer.Chatted:connect(function(msg, recipient)
        onChatted(msg, recipient, newPlayer)
    end)
end)

If you are trying to fix the script for me, here is the link for the uniforms https://www.roblox.com/catalog/browse.aspx?CreatorID=85125160%20&IncludeNotForSale=true&SortType=3

[THIS ISN'T A REQUEST I DON'T KNOW HOW TO ADD IT]

Answer this question