local hulkc = game.Players.LocalPlayer.Character.BodyColors hulkcolor.HeadColor = "Sea green" wait(1) hulkcolor.LeftArmColor = "Sea green" wait(1) hulkcolor.RightArmColor = "Sea green" wait(1) hulkcolor.RightLegColor = "Bright violet" wait(1) hulkcolor.LeftLegColor = "Bright violet" wait(1) hulkcolor.TorsoColor = "Sea green"
it says BodyColors isnt a valid member of the model ?????
Locate Body Colors like so: Character["Body Color"]
or use :FindFirstChild()
or even better: :WaitForChild()
.
Character["Body Color"] Character:FindFirstChild("Body Color") Character:WaitForChild("Body Color")
You can also stop using LocalScripts all together, because in this situation, it'll be easier to use a server Script.
ServerSided:
* Runs after the server is loaded
* Can affect only server-sided actions
* Can affect other players
ClientSided:
* Runs as soon as possible
* Only affects the Player
* Only runs if inside of a Descendant of Player
["Body Color"] is the same as calling something like so: Character.BodyColor. If it doesn't exist, the script will error and the script will stop itself there.
:FindFirstChild()
is the same but will return nil if it doesn't exist and will still run the rest of the code.
:WaitForChild()
is the same as above, but will Yield the script(even though it's technically a regular function) for 5 seconds and will return nil if the object doesn't exist for 5 seconds. Note it has a 2nd parameter than can change how long the function will yield.
game:GetService("Players").PlayerAdded:connect(function(plyr) plyr.CharcterAdded:connect(function(char) repeat wait() until char:FindFirstChild("Body Color") --This way we don't need to worry about the 5 second time limit because each computer is different. local hulkcolor = char:FindFirstChild("Body Color") hulkcolor.HeadColor = "Sea green" hulkcolor.LeftArmColor = "Sea green" hulkcolor.RightArmColor = "Sea green" hulkcolor.RightLegColor = "Bright violet" hulkcolor.LeftLegColor = "Bright violet" hulkcolor.TorsoColor = "Sea green" end) end)
Hope it helps!