generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How do you get a Body Color from the BodyColor object?

Previous Thread :: Next Thread 
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
19 Apr 2015 10:53 AM
So, inside a script, I need to change the BodyColors back to what they were before, so I've ran:

v.BrickColor = BrickColor.new(Player.Character["Body Colors"].HeadColor)

How exactly do you reference the color from the BodyColor object?

I've tried just .HeadColor, .HeadColor.Value, and .HeadColor.BrickColor.

They didn't work, but hey, they were worth a shot.
Report Abuse
enzotinman1 is not online. enzotinman1
Joined: 22 Jun 2012
Total Posts: 408
19 Apr 2015 11:05 AM
im not sure what you mean but cant you just have a variable of the colors from before.
e.g.
headColor = Player.Character.Head.BrickColor

then that color is stored in the variable 'headColor' which you can access later
e.g.
v.BrickColor = BrickColor.new(headColor)

i havnt tested it or know what your talking about but ill just write it anyway :L
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
19 Apr 2015 11:07 AM
That is possible, but I was hoping to use the Body Colors object to simplify things.
Report Abuse
Intern33t is not online. Intern33t
Joined: 19 Nov 2010
Total Posts: 1530
19 Apr 2015 11:09 AM
workspace.Part.BrickColor = workspace.Player["Body Colors"].HeadColor

this worked for me
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
19 Apr 2015 11:12 AM
It tells me, "'new' (Color3 expected, got userdata)"
Report Abuse
enzotinman1 is not online. enzotinman1
Joined: 22 Jun 2012
Total Posts: 408
19 Apr 2015 11:13 AM
isnt Player.Character.Head.BrickColor the same as Player.Character["BodyColors"].HeadColor
?
Report Abuse
Intern33t is not online. Intern33t
Joined: 19 Nov 2010
Total Posts: 1530
19 Apr 2015 11:14 AM
not always, enzo. just on join, after join the headcolor can be changed and then it will be not the same with Body Colors.HeadColor
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
19 Apr 2015 11:20 AM
Enzo, I change it when the Player uses their sword.
Report Abuse
enzotinman1 is not online. enzotinman1
Joined: 22 Jun 2012
Total Posts: 408
19 Apr 2015 11:25 AM
i don't really understand what the problem is :L
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
19 Apr 2015 11:35 AM
I have a function that runs when the player equips and unequips a sword.

I have an argument to tell whether or not they are equipping the sword or unequipping it.

When it's equipped, it changes the players' body color.

When it's unequipped, I want it to change the body color back which is located inside of the Body Colors object.
Report Abuse
enzotinman1 is not online. enzotinman1
Joined: 22 Jun 2012
Total Posts: 408
19 Apr 2015 11:42 AM
when they equip the sword cant you make a variable of game.Workspace.Player["Body Colors"]
then when they unequipped do game.Workspace.Player["Body Colors"] = (variable from before)
Report Abuse
enzotinman1 is not online. enzotinman1
Joined: 22 Jun 2012
Total Posts: 408
19 Apr 2015 11:43 AM
not game.workspace but the player...you know what i mean
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
19 Apr 2015 11:47 AM
I got it to work, nevermind.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image