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

Can i have some help with my character team morph script?

this is the code:

while true do
    local Player = script.Parent
    if Player ~= nil then
        Player.TeamColor = BrickColor ("Lapis") 
    Player:WaitForChild("Shirt")
Player.Shirt:Destroy()
    Player:WaitForChild("Pants")
Player.Pants:Destroy()
    Player:WaitForChild("BodyColors")
b=Player.BodyColors
    b.HeadColor = ("Medium Green")
b.LeftArmColor = ("Medium Green")
    b.LeftLegColor = ("Brown")
b.RightArmColor = ("Medium Green")
    b.RightLegColor = "Brown"
b.TorsoColor = "Brown"
    Player:WaitForChild("ShirtGraphic")
Player.ShirtGraphic:Destroy()
for _, v in pairs(Player:GetChildren()) do
    if v:IsA("Accoutrement") then
     v:Destroy()
Player:WaitForChild("CharacterMesh")
Player.CharacterMesh:Destroy()

end
end
end

Instance.new("Hat",Player)
    Instance.new("Part",Player.Hat)
Instance.new("Hat",Player.Hat)
m=Player.Hat.Part.Mesh
m.MeshId = ("rbxassetid://24477146")
m.TextureId = ("rbxassetid://25289515")
Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "LeftArm"
Player.LeftArm.MeshId = ("rbxassetid://24477146")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37686282")

Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "LeftLeg"
Player.LeftArm.MeshId = ("rbxassetid://37683150")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37687646")

Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "RightArm"
Player.LeftArm.MeshId = ("rbxassetid://37683174")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37686282")

Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "RightLeg"
Player.LeftArm.MeshId = ("rbxassetid://37683227")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37687646")

Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "Torso"
Player.LeftArm.MeshId = ("rbxassetid://37683263")
Player.LeftArm.OverlayTextureId = ("rbxassetid://0")


end

i'm trying to make it so that when you are on the Lapis team, you have this skin customization. So far this doesn't work in Roblox Studio. Any tiny mistakes in this code that i'm missing?

7 comments

2

CODE BLOCK AAAAA

1

soooo you think its perfectly fine to dump us in a random city and expect us to know our way around?

0

Edit the question, and place the code in a Lua block, this way we can't read it, therefore we can't help.

0

Can you please clarify the question by adding code-blocks for the Codes? Thank you

0

He was just told 4 times to use a code block. Don't comment and repeat what others just said.

0

sorry i'm kinda new to this site, just updated it

2

does like everyone else think that they understand this code and not vote up my moderation?

1 answer

✓ Accepted answer

Here's some fixed up code. Please indent too as it allows people on this site to read your code better. All I did is fix your BrickColor because that's what was wrong according to the code you posted. I'm also assuming that this script is in the player's character.

while true do
    local Player = script.Parent
    if Player ~= nil then
        Player.TeamColor = BrickColor.new("Lapis") --Make sure to put .new after BrickColor 
        Player:WaitForChild("Shirt")
        Player.Shirt:Destroy()
        Player:WaitForChild("Pants")
        Player.Pants:Destroy()
        Player:WaitForChild("BodyColors")
        b=Player.BodyColors
        b.HeadColor = ("Medium Green")
        b.LeftArmColor = ("Medium Green")
        b.LeftLegColor = ("Brown")
        b.RightArmColor = ("Medium Green")
        b.RightLegColor = "Brown"
        b.TorsoColor = "Brown"
        Player:WaitForChild("ShirtGraphic")
        Player.ShirtGraphic:Destroy()
        for _, v in pairs(Player:GetChildren()) do
            if v:IsA("Accoutrement") then
                v:Destroy()
                Player:WaitForChild("CharacterMesh")
                Player.CharacterMesh:Destroy()

             end
        end
    end

Instance.new("Hat",Player)
Instance.new("Part",Player.Hat)
Instance.new("Hat",Player.Hat)
m=Player.Hat.Part.Mesh
m.MeshId = ("rbxassetid://24477146")
m.TextureId = ("rbxassetid://25289515")
Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "LeftArm"
Player.LeftArm.MeshId = ("rbxassetid://24477146")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37686282")
	
Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "LeftLeg"
Player.LeftArm.MeshId = ("rbxassetid://37683150")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37687646")
	
Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "RightArm"
Player.LeftArm.MeshId = ("rbxassetid://37683174")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37686282")
	
Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "RightLeg"
Player.LeftArm.MeshId = ("rbxassetid://37683227")
Player.LeftArm.OverlayTextureId = ("rbxassetid://37687646")
	
Instance.new("CharacterMesh",Player)
Player.CharacterMesh:WaitForChild()
Player.CharacterMesh.Name = "Torso"
Player.LeftArm.MeshId = ("rbxassetid://37683263")
Player.LeftArm.OverlayTextureId = ("rbxassetid://0")


end

2 comments

0

So it goes in the StarterPlayerScript in Roblox Studio?

0

If you want it in the player then yes, if you want it in the character which is in Workspace, then place it in StarterCharacterScripts.

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