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

How Do I Add Clothing On A Incoming Character?

Asked by 8 years ago

I am building a new FPS game on roblox, and I need to add army clothing to a specific group. But I don't know how to do that. I need to script a Stater Character, but I cant find anything in the wiki to explain how to do this particular action. I really need help with this. Please someone help me!

0
As in group, you mean team? Or a set of players chosen by the script? legosweat 334 — 8y
0
ok what im looking for is that i need to know how to make a set of players chosen by the script supercoolboy8804 114 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I compiled this code just for you.

By using IsInGroup this script checks if you are in the group, if the player is; then you change into a certain outfit.

local groupId = 0
local shirtId = 0
local pantsId = 0
local skin = "Brick yellow"--BrickColor for skin
local teamColor = "Bright red"--Your group's team color

game.Workspace.ChildAdded:connect(function(plr)
    if plr:IsInGroup(groupId) then
        local name = plr.Name
        local playerinplayers = game.Players:FindFirstChild(plr.Name)
        playerinplayers.CanLoadCharacterAppearance = false

        local bodycolors = Instance.new("BodyColors", plr)
        bodycolors.RightArmColor = BrickColor.new(skin)     
        bodycolors.LeftArmColor = BrickColor.new(skin)  
        bodycolors.HeadColor = BrickColor.new(skin) 
        bodycolors.RightLegColor = BrickColor.new(skin) 
        bodycolors.LeftLegColor = BrickColor.new(skin)      
        bodycolors.TorsoColor = BrickColor.new(skin)    

        local shirt = Instance.new("Shirt")
        shirt.Parent = plr
        shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..shirtId - 1

        local pants = Instance.new("Pants")
        pants.Parent = plr
        pants.ShirtTemplate = "http://www.roblox.com/asset/?id="..pantsId - 1

        playerinplayers.TeamColor = BrickColor.new(teamColor)

    end
end)

http://wiki.roblox.com/index.php?title=API:Class/Player/IsInGroup

Ad

Answer this question