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
game.Workspace.ChildAdded:connect(function(plr)
local player = game.Players.LocalPlayer
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
    playerinplayers.CanLoadCharacterAppearance = false
    plr.Head.face.Texture = "rbxassetid://"
    local bodycolors = Instance.new("BodyColors",plr)
    bodycolors.RightArmColor = BrickColor.new("Pastel brown")
    bodycolors.LeftArmColor = BrickColor.new("Pastel brown")
    bodycolors.LeftLegColor = BrickColor.new("Dark stone grey")
    bodycolors.RightLegColor = BrickColor.new("Dark stone grey")
    bodycolors.TorsoColor = BrickColor.Random()
    bodycolors.HeadColor = BrickColor.new("Pastel Brown")
end





end)

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

local S = Instance.new("Shirt")
local 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.

game.Workspace.ChildAdded:connect(function(plr)
local player = game.Players.LocalPlayer
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(name)
if playerinplayers ~= nil then
    playerinplayers.CanLoadCharacterAppearance = false
    plr.Head.face.Texture = "rbxassetid://"
    local bodycolors = Instance.new("BodyColors",plr)
    bodycolors.RightArmColor = BrickColor.new("Pastel brown")
    bodycolors.LeftArmColor = BrickColor.new("Pastel brown")
    bodycolors.LeftLegColor = BrickColor.new("Dark stone grey")
    bodycolors.RightLegColor = BrickColor.new("Dark stone grey")
    bodycolors.TorsoColor = BrickColor.Random()
    bodycolors.HeadColor = BrickColor.new("Pastel Brown")
end





end)

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