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

How would I tweak this?

Asked by 9 years ago
01game.Workspace.ChildAdded:connect(function(plr)
02local player = game.Players.LocalPlayer
03local name = plr.Name
04local playerinplayers = game.Players:FindFirstChild(plr.Name)
05if playerinplayers ~= nil then
06    playerinplayers.CanLoadCharacterAppearance = false
07    plr.Head.face.Texture = "rbxassetid://"
08    local bodycolors = Instance.new("BodyColors",plr)
09    bodycolors.RightArmColor = BrickColor.new("Pastel brown")
10    bodycolors.LeftArmColor = BrickColor.new("Pastel brown")
11    bodycolors.LeftLegColor = BrickColor.new("Dark stone grey")
12    bodycolors.RightLegColor = BrickColor.new("Dark stone grey")
13    bodycolors.TorsoColor = BrickColor.Random()
14    bodycolors.HeadColor = BrickColor.new("Pastel Brown")
15end
View all 21 lines...

My idea is to give players a uniform like one you see on the catalog. What would I do to have a uniform on the character, instead of colors?

1 answer

Log in to vote
2
Answered by 9 years ago

Well my answer most likely would be to change the shirt and pants texture. or to delete the current shirt and pants and then do

1local S = Instance.new("Shirt")
2local P = Instance.new("Pants")

then just do S.TextureId or whatever it and and use a string for your new ID. as well as that I have tweeked your script a little concidering you did some weird things that I will explain below.

01game.Workspace.ChildAdded:connect(function(plr)
02local player = game.Players.LocalPlayer
03local name = plr.Name
04local playerinplayers = game.Players:FindFirstChild(name)
05if playerinplayers ~= nil then
06    playerinplayers.CanLoadCharacterAppearance = false
07    plr.Head.face.Texture = "rbxassetid://"
08    local bodycolors = Instance.new("BodyColors",plr)
09    bodycolors.RightArmColor = BrickColor.new("Pastel brown")
10    bodycolors.LeftArmColor = BrickColor.new("Pastel brown")
11    bodycolors.LeftLegColor = BrickColor.new("Dark stone grey")
12    bodycolors.RightLegColor = BrickColor.new("Dark stone grey")
13    bodycolors.TorsoColor = BrickColor.Random()
14    bodycolors.HeadColor = BrickColor.new("Pastel Brown")
15end
View all 21 lines...

So on line 4 you used plr.Name in the parenthises when you already defined it so I replaced it with just name. I would also recommend deleting the current body colors setting for instance new because that would make 2 bodycolor things inside the character thus confusing roblox. so you can have it so it removes the current body colors and then makes a new instance with these new colors.

Ad

Answer this question