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.
bodyColors = {'HeadColor', 'LeftArmColor', 'LeftLegColor', 'RightArmColor', 'RightLegColor', 'TorsoColor'} for _,color in pairs(bodyColors) do workspace.Player1["Body Colors"][color] = BrickColor.new("Institutional white") end
You can use the PlayerAdded
event and the CharacterAdded
event to make a character's body Institution white everytime they respawn.
bodyColors = {'HeadColor', 'LeftArmColor', 'LeftLegColor', 'RightArmColor', 'RightLegColor', 'TorsoColor'} game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) for _,color in pairs(bodyColors) do char["Body Colors"][color] = BrickColor.new("Institutional white") end end) end)
Though there may be some cases that a character won't have the Body Colors object so this may work.
bodyParts = {'Head', 'Left Arm', 'Left Leg', 'Right Arm', 'Right Leg', 'Torso'} game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) for _,part in pairs(bodyParts) do char[part].BrickColor = BrickColor.new("Institutional white") end end) end)
~coo1o
Well, it's pretty easy. Which body part do you want to change, though? we'll go for torso for now.
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:
Plrs = Game:GetService("Players") Plrs.PlayerAdded:connect(function(Plr) Plr.CharacterAdded:connect(function(Char) for i, v in pairs(Char:GetChildren()) do if v:IsA("Part") then v.BrickColor = BrickColor.new("Institutional white") end end end) 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.
function onPlayerEntered player.CharacterAdded:connect(function(char) while wait(0) do Game.Workspace.Character.Torso.BrickColor.new = ("Institutional white") Game.Workspace.Character.LeftArm.BrickColor.new = ("Institutional white") Game.Workspace.Character.RightArm.BrickColor.new = ("Institutional white") Game.Workspace.Character.Head.BrickColor.new = ("Institutional white") Game.Workspace.Character.LeftLeg.BrickColor.new = ("Institutional white") Game.Workspace.Character.RightLeg.BrickColor.new = ("Institutional white") end end) end game.Players.PlayerAdded:connect(onPlayerEntered)