So I want to Change my body color, but i keep getting confused when trying to label the BodyParts, or If I'm susposed to use "Larm" as a Variable or something.
My Scripting Knowledge is Limited, and LuaLearners is Down.....This doesn't go well.
Im trying to change it to "Institutional white"
Here's a nice dealio using a table and the Body Colors object of character models.
1 | bodyColors = { 'HeadColor' , 'LeftArmColor' , 'LeftLegColor' , 'RightArmColor' , 'RightLegColor' , 'TorsoColor' } |
2 | for _,color in pairs (bodyColors) do |
3 | workspace.Player 1 [ "Body Colors" ] [ color ] = BrickColor.new( "Institutional white" ) |
4 | end |
You can use the PlayerAdded
event and the CharacterAdded
event to make a character's body Institution white everytime they respawn.
01 | bodyColors = { 'HeadColor' , 'LeftArmColor' , 'LeftLegColor' , 'RightArmColor' , 'RightLegColor' , 'TorsoColor' } |
02 |
03 |
04 | game:GetService( 'Players' ).PlayerAdded:connect( function (player) |
05 | player.CharacterAdded:connect( function (char) |
06 | for _,color in pairs (bodyColors) do |
07 | char [ "Body Colors" ] [ color ] = BrickColor.new( "Institutional white" ) |
08 | end |
09 | end ) |
10 | end ) |
Though there may be some cases that a character won't have the Body Colors object so this may work.
01 | bodyParts = { 'Head' , 'Left Arm' , 'Left Leg' , 'Right Arm' , 'Right Leg' , 'Torso' } |
02 |
03 |
04 | game:GetService( 'Players' ).PlayerAdded:connect( function (player) |
05 | player.CharacterAdded:connect( function (char) |
06 | for _,part in pairs (bodyParts) do |
07 | char [ part ] .BrickColor = BrickColor.new( "Institutional white" ) |
08 | end |
09 | end ) |
10 | end ) |
~coo1o
Well, it's pretty easy. Which body part do you want to change, though? we'll go for torso for now.
1 | Game.Workspace.Name.Torso.BrickColor = BrickColor.new( "Institutional white" ) --turn "name" into your name |
Here's a little script I made just for you. I hope it works. I just kinda wrote this in Notepad, but it should work, it's not that complex.
Script:
01 | Plrs = Game:GetService( "Players" ) |
02 | Plrs.PlayerAdded:connect( function (Plr) |
03 | Plr.CharacterAdded:connect( function (Char) |
04 | for i, v in pairs (Char:GetChildren()) do |
05 | if v:IsA( "Part" ) then |
06 | v.BrickColor = BrickColor.new( "Institutional white" ) |
07 | end |
08 | end |
09 | end ) |
10 | end ) |
Well I hope it works... Tell me if there's an error.
I came up with this script. But i think it's not going to work.
01 | function onPlayerEntered |
02 | player.CharacterAdded:connect( function (char) |
03 | while wait( 0 ) do |
04 | Game.Workspace.Character.Torso.BrickColor.new = ( "Institutional white" ) |
05 | Game.Workspace.Character.LeftArm.BrickColor.new = ( "Institutional white" ) |
06 | Game.Workspace.Character.RightArm.BrickColor.new = ( "Institutional white" ) |
07 | Game.Workspace.Character.Head.BrickColor.new = ( "Institutional white" ) |
08 | Game.Workspace.Character.LeftLeg.BrickColor.new = ( "Institutional white" ) |
09 | Game.Workspace.Character.RightLeg.BrickColor.new = ( "Institutional white" ) |
10 | end |
11 | end ) |
12 | end |
13 |
14 | game.Players.PlayerAdded:connect(onPlayerEntered) |