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 » Scripting Helpers
Home Search
 

Re: Saving and loading Color3 Values using DataStore?

Previous Thread :: Next Thread 
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
17 Apr 2014 01:09 PM
Alright, so I'm extremely confused here... I've been trying to save a Color3 value with DataStore for a while now, tried using tostring(), tonumber() amongst other things, but to no avail.
Does anyone know how to do this? Thanks

~The herp lerped a derp~
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
17 Apr 2014 02:02 PM
Bump :/
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
17 Apr 2014 03:08 PM
Aaand bump again... ._.
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
17 Apr 2014 03:15 PM
Save each number of the Color3 value as an int. Example:
Color3.new(1,0,1)

key==>value
red==>1
green==>0
blue==>1

To load it you'd load the values of red, green and blue and put them like this:
Color3.new(red, green, blue)
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
17 Apr 2014 03:17 PM
How would I get the separated rgb values from a Color3 value?

~The herp lerped a derp~
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
17 Apr 2014 03:18 PM
local color = Color3.new(r,g,b)
print(color.r)
Report Abuse
Kuas is not online. Kuas
Joined: 06 May 2011
Total Posts: 518
17 Apr 2014 03:18 PM
You would want to save it as something other than an integer, probably just a plain number.

And to answer your most recent question: Color3.r Color3.g Color3.b
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
17 Apr 2014 03:18 PM
Nice, will see if that works.

~The herp lerped a derp~
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
17 Apr 2014 03:23 PM
I would just create a table out of Color3's R, G and B.
MyColor = {R,G,B}

Then EncodeJSON, save the string.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
17 Apr 2014 03:23 PM
http://wiki.roblox.com/index.php/EncodeJSON_(Function)
Report Abuse
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
17 Apr 2014 03:29 PM
I would just save the value as strings.

valR = Color3.r
valG = Color3.g
valB = Color3.b

_G.ZirutoHellfire = loadfile(C://Home/Images/ZirutoHellfire.png)
_G.ZirutoHellfire:Clone().Parent = Roblox.Forums["Club Houses"]["Clans & Guilds"]
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
17 Apr 2014 03:47 PM
Getting an error while trying to get the rgb properties...
"22:45:43.410 - R is not a valid member of Color3Value"

On this line:
statstable2[1] = player.PlayerStats.skincolor.r

~The herp lerped a derp~
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
17 Apr 2014 03:53 PM
.Value.r
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
17 Apr 2014 04:05 PM
@RoflBread
Thanks, worked like a charm. :)

And thanks to everyone else as well for helping me out, I really appreciate it ^^

~The herp lerped a derp~
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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