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

How Do I Add Clothing On A Incoming Character?

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!

2 comments

0

As in group, you mean team? Or a set of players chosen by the script?

0

ok what im looking for is that i need to know how to make a set of players chosen by the script

1 answer

✓ Accepted answer

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

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