Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ServerScriptService.DataStore:82: bad argument #3 to 'Value' (BrickColor expected, got number) ?

local PrimaryColor = Instance.new("BrickColorValue",Storage)
	PrimaryColor.Name = "PrimaryColor"
	PrimaryColor.Value = PrimaryColor1:GetAsync(player.UserId) or BrickColor.Random()
	PrimaryColor.Changed:connect(function()
	PrimaryColor1:SetAsync(player.UserId,PrimaryColor.Value)
	end)

At line 3.

5 comments

0

Thanks beforehand xd

0

It would be nice to see the color value modified before the script. I can't really understand the issue fully yet.

0

You can't store userdatas in data stores. A BrickColor is considered a userdata. You may want to save the name of the BrickColor (PrimaryColor.Value.Name), BrickColors have a Name property.

0

The constructor for the brick color would then be BrickColor.new(PrimaryColor.Value.Name).

0

Oh, I’ll try this method when I get home. Thx

1 answer

the thing your doing wrong is that your using a BrickColorValue, not a Color3Value if there is one but BrickColors arent numbers though words like Really red. Im not sure whats PrimaryColor1 nor Storage, but i guess its a number of some sort. I just looked at the error lol so im not sure

also the parent parameter of Instance.new() is decaperated, set the parent last such as this:

not

local ack = Instance.new("Part", workspace)

ack.Name = "hi"

this

local ack = Instance.new("Part")

ack.Name = "hi"
ack.Parent = workspace  

This discussion is preserved as it was. New answers, comments, and votes are closed.