--[[
	
	Creates & returns a value instance from 1st argument.
	
	Functions.QuickValue(
		..., 					<-- |REQ|	Anything
	)
	
--]]




return function(value, parent)
	--- Var
	local valueType
	
	--- Grab type of userdata
	if type(value) == "boolean" then
		--- Booleans
		valueType = "BoolValue"
	
	elseif type(value) == "number" then
		--- Numbers/integers
		valueType = "NumberValue"
		
	elseif type(value) == "string" then
		--- Strings
		valueType = "StringValue"
		
	elseif typeof(value) == "BrickColor" then
		--- BrickColors
		valueType = "BrickColorValue"
	
	elseif typeof(value) == "CFrame" then
		--- CFrames
		valueType = "CFrameValue"
		
	elseif typeof(value) == "Color3" then
		--- Color3s
		valueType = "Color3Value"
		
	elseif typeof(value) == "Ray" then
		--- Rays
		valueType = "RayValue"
		
	elseif typeof(value) == "Vector3" then
		--- Vector3s
		valueType = "Vector3Value"
	
	elseif typeof(value) == "Instance" then
		--- Instances
		valueType = "ObjectValue"
	end
	
	--- Successfully grabbed type?
	if valueType then
		--- Create value instance
		local valueObj = Instance.new(valueType)
		valueObj.Value = value
		
		--- Parent if argument provided
		if parent then
			valueObj.Parent = parent
		end
		
		--
		return valueObj
		
	else
		--- Value not supported (or nil)
		_L.Print("Value type not supported", true)
	end
end
