Suggestion: Add more BaseValues

I didn’t know where to put this topic, so I related it to “Feedback”.

Roblox has a few Value instances. CFrame, Int, Color, etc. But I sometimes feel it would be neat to have more. I come across properties from instances that have a ‘Value’ of a table, links, and other unordinary things. I just wanted to suggest adding more of these.

Let me go over some uses for some of these new values.

  • DictionaryValue:
    Store Datastores more than one script can access them without obtaining a datastore twice.
    Store inventory data for FPS, RPG, simulator, etc games.

  • ArrayValue:
    Store basic data. Like players that are banned, that have joined, or that are alive in a round.

  • TimestampValue:
    Save the time the server was created for more than one script.

  • VariantValue:
    Sometimes, when you put a value in a BaseValue, it rejects your input. Like if you put a decimal in an int value. Or nil in any value. Variant values accept anything you put in. Quotes would be in the value to show the value you wanted a string, and not a number.

  • URLValue:
    Store URLs you want more than one script to access. Like for the HTTPService. And now that videos are out, you could store YouTube links too.

  • FunctionValue:
    Store global or local functions. Like math.cos(), and settings().

  • UDim2Value

  • UDimValue

  • Vector2Value

  • OperationValue (store +, -, *, /, or ^)

  • EnumValue (store an index of Enum)

  • EnumItemValue (store an EnumItem)

2 Likes

It’s not scripting related, so it can go in Platform feedback. Although I can understand why you put it here lol

Edit: You prolly already know this, but you can edit this post and change where it is located

I’ll try putting it in platform feedback then…

1 Like

I don’t think I have access to that category.

1 Like

Some of these aren’t a good idea. But here you go!

In all honesty, most of these can be done with what we currently have using a StringValue, tables and modules. It’s not ideal to promote BaseValues. Why? Because tables are simply better and more optimized for a game rather having an instance for a value.

You can make a module have have some functions, here some example(s).

local function toenum(enumType, str)
return Enum[enumType][str]
end

As for array and dictionary or even function you can use a ModuleScript.
As for variant, timestamp, URL you can use a string value.

The other ones seem pointless.

People that don’t know how to script well can benefit from some of the values. Like DictionaryValues, to set default data for modules that aren’t their own. Like HD, Kohls, and Adonis Admin.

If dictionary values it would look no different than a module or it’d look like:
{index={index = 2},{index = value}}
something like that which doesn’t really help and that’s just a normal table compacted into one line. What you should be suggesting is adding maybe a table visualizer which would sort in a T table and would return that.

1 Like

Woah Function values sound awesome how would they work though?

That sounds very exploitable and problem causing in a lot of ways.

They are just ideas… But a FunctionValue’s Value property would be scriptable only, and one script can apply a function, so other scripts can use it. Say you have a Piggy based game. You want things to happen to a player, but on the client side, and you don’t want to make alot of remotefunctions/events. A local script would pick up this function, and then run it.

Some of the values don’t need to be created because of the fact you can use loadstring to get values from a StringValue. For example:

local stringvalue = Instance.new("StringValue")
stringvalue.Value = "UDim2.new(0.5,0,0.5,0)"
-- the value would be a string, not a UDim2. to fix you would then say
local value = loadstring("return " .. stringvalue.Value)() --> UDim2

This would work, but theres a problem. What if loadstring wasn’t enabled? Loadstring allows hackers to be more aggressive with their scripts. If we had some of these new values, we wouldn’t have to write the script above.

This belongs in #platform-feedback:studio-features, do not create a post in the wrong category to avoid post approval.

In my opinion using BaseValue instances is bad practice due to the added overhead they provide. Just use a BindableEvent, RemoteEvent, or MolduleScript to share values depending on your needs.